ref: d1f933cdea74c54335b7078d823a75c8ee751982
parent: f5bfe1d30b12311b6347ca71eb00b4ca86ff7484
author: Ori Bernstein <[email protected]>
date: Tue Jun 19 15:26:42 EDT 2012
Fix string frobbing.
--- a/8/main.c
+++ b/8/main.c
@@ -53,7 +53,8 @@
len = strlen(infile);
if (len + strlen(suffix) >= sz)
die("Output file name too long");
- strncpy(buf, infile, len);
+ buf[0] = '\0';
+ strncat(buf, infile, len);
strcat(buf, suffix);
return buf;