We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c5e3fc commit 753f120Copy full SHA for 753f120
src/libgit2/src/refs.c
@@ -232,7 +232,13 @@ int git_reference_lookup_resolved(
232
nesting--)
233
{
234
if (nesting != max_nesting) {
235
- strncpy(scan_name, ref->target.symbolic, sizeof(scan_name));
+ /* Fix in git2r to handle a significant
236
+ warning from 'R CMD check'
237
+ libgit2/src/refs.c:235:4: warning:
238
+ ‘strncpy’ specified bound 1024 equals
239
+ destination size [-Wstringop-truncation] */
240
+ strncpy(scan_name, ref->target.symbolic, sizeof(scan_name) - 1);
241
+ /* strncpy(scan_name, ref->target.symbolic, sizeof(scan_name)); */
242
git_reference_free(ref);
243
}
244
0 commit comments