Skip to content

Commit

Permalink
Replace strncpy with memcpy.
Browse files Browse the repository at this point in the history
This solves the truncation compiler warning.
  • Loading branch information
daltomi authored and eribertomota committed Jun 11, 2019
1 parent 53e0d5b commit a3a2d12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ void scrot_check_if_overwrite_file(char **filename)

if (extension)
// exclude extension
strncpy(newname, curfile, slen - 4);
memcpy(newname, curfile, slen - 4);
else
strncpy(newname, curfile, slen);
memcpy(newname, curfile, slen);

do {
snprintf(fmt, 5, "_%03d", count++);
Expand Down

0 comments on commit a3a2d12

Please sign in to comment.