Browse Source

Update error message when xstrndup fails

Previous patch to xstrndup increased the size of the allocated
block by one byte but neglected to update the error message
accordingly.
develop
Damien Goutte-Gattat 5 years ago
parent
commit
1a2c5fdb04
  1. 2
      lib/xmem.c

2
lib/xmem.c

@ -97,7 +97,7 @@ xstrndup(const char *s, size_t n)
char *dup;
if ( ! (dup = malloc(n + 1)) )
mem_error(n);
mem_error(n + 1);
strncpy(dup, s, n);
dup[n] = '\0';

Loading…
Cancel
Save