Skip to content

Commit

Permalink
Remove warning due to using strncpy.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldesnogu committed Sep 7, 2024
1 parent dbd171c commit b592aa6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Mlucas.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,8 @@ with the default #threads = 1 and affinity set to logical core 0, unless user ov

// Copy all but the final (pm1_done) char of the assignment into g_cstr and append pm1_done = 1. If g_in_line ends with newline, first --j:
j = strlen(g_in_line) - 1; j -= (g_in_line[j] == '\n');
strncpy(g_cstr,g_in_line,j); g_cstr[j] = '\0'; strcat(g_cstr,"1\n");
// Note we over copy with strcpy, but since the end of string is explictly set, that's no issue.
strcpy(g_cstr, g_in_line); g_cstr[j] = '\0'; strcat(g_cstr,"1\n");
split_curr_assignment = TRUE; // This will trigger the corresponding code following the goto:
goto GET_NEXT_ASSIGNMENT;
}
Expand Down

0 comments on commit b592aa6

Please sign in to comment.