Skip to content

Commit

Permalink
Avoid tricky macro usage in memcpy() call in dump_buffer()
Browse files Browse the repository at this point in the history
Apparently this leads to compiler errors on NetBSD when compiling
with Stack Smashing Protection (SSP).

See also:

* NetBSD/pkgsrc-wip@c457663#r135218375
  • Loading branch information
craigbarnes committed Dec 18, 2023
1 parent bbef149 commit 77bec65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ String dump_buffer(const Buffer *buffer)
char modestr[12];
char timestr[64];
if (!timespec_to_str(&file->mtime, timestr, sizeof(timestr))) {
memcpy(timestr, STRN("[error]") + 1);
static const char msg[] = "[error]";
memcpy(timestr, msg, sizeof(msg));
}

string_sprintf (
Expand Down

0 comments on commit 77bec65

Please sign in to comment.