committed by
Nikolay Igotti
parent
e36b5d3476
commit
c1d9dc1cbb
@@ -43,7 +43,7 @@ fun main(args: Array<String>) {
|
||||
val buffer = allocArray<CInt8Var>(bufferLength)
|
||||
|
||||
for (i in 1..count) {
|
||||
val nextLine = fgets(buffer[0].ptr, bufferLength, file)?.toKString()
|
||||
val nextLine = fgets(buffer, bufferLength, file)?.toKString()
|
||||
if (nextLine == null || nextLine.isEmpty()) break
|
||||
|
||||
val records = parseLine(nextLine, ',')
|
||||
|
||||
@@ -22,7 +22,7 @@ class GitRepository(val location: String) {
|
||||
val size = remoteList.count.value.toInt()
|
||||
val list = ArrayList<GitRemote>(size)
|
||||
for (index in 0..size - 1) {
|
||||
val array = remoteList.strings.value!!.reinterpret<CArray<CPointerVar<CInt8Var>>>().pointed
|
||||
val array = remoteList.strings.value!!
|
||||
val name = array[index].value!!.toKString()
|
||||
val remotePtr = allocPointerTo<git_remote>()
|
||||
git_remote_lookup(remotePtr.ptr, handle, name).errorCheck()
|
||||
|
||||
@@ -35,14 +35,14 @@ fun main(args: Array<String>) {
|
||||
.ensureUnixCallResult { it >= 0 }
|
||||
|
||||
while (true) {
|
||||
val length = read(commFd, buffer.ptr, bufferLength)
|
||||
val length = read(commFd, buffer, bufferLength)
|
||||
.ensureUnixCallResult { it >= 0 }
|
||||
|
||||
if (length == 0L) {
|
||||
break
|
||||
}
|
||||
|
||||
write(commFd, buffer.ptr, length)
|
||||
write(commFd, buffer, length)
|
||||
.ensureUnixCallResult { it >= 0 }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user