mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -04:00
refactor: use explicit string length when converting from buffer to Dart string
This commit is contained in:
parent
f4e9ae4167
commit
0a758b771a
7 changed files with 22 additions and 22 deletions
|
@ -224,7 +224,7 @@ String remoteName({
|
|||
calloc.free(out);
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
final result = out.ref.ptr.cast<Utf8>().toDartString();
|
||||
final result = out.ref.ptr.cast<Utf8>().toDartString(length: out.ref.size);
|
||||
calloc.free(out);
|
||||
return result;
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ String upstreamName({
|
|||
calloc.free(out);
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
final result = out.ref.ptr.cast<Utf8>().toDartString();
|
||||
final result = out.ref.ptr.cast<Utf8>().toDartString(length: out.ref.size);
|
||||
calloc.free(out);
|
||||
return result;
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ String upstreamRemote({
|
|||
calloc.free(out);
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
final result = out.ref.ptr.cast<Utf8>().toDartString();
|
||||
final result = out.ref.ptr.cast<Utf8>().toDartString(length: out.ref.size);
|
||||
calloc.free(out);
|
||||
return result;
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ String upstreamMerge({
|
|||
calloc.free(out);
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
final result = out.ref.ptr.cast<Utf8>().toDartString();
|
||||
final result = out.ref.ptr.cast<Utf8>().toDartString(length: out.ref.size);
|
||||
calloc.free(out);
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue