blob: 6b13be7d9e5dc9ea9f7bbd7ca329ee8db3de6a15 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
*** tosha.c.orig Fri Jan 1 16:57:49 1999
--- tosha.c Sun Dec 10 01:04:54 2000
***************
*** 240,247 ****
return template;
if (!(tmpstr = malloc(strlen(template) + strlen(formatspec->ext) - 1)))
out_of_memory();
! if ((prefix = cptr - template))
strncpy (tmpstr, template, prefix);
strcat (tmpstr + prefix, formatspec->ext);
prefix += strlen(formatspec->ext);
strcat (tmpstr + prefix, cptr + 2);
--- 240,249 ----
return template;
if (!(tmpstr = malloc(strlen(template) + strlen(formatspec->ext) - 1)))
out_of_memory();
! if ((prefix = cptr - template)) {
strncpy (tmpstr, template, prefix);
+ tmpstr[prefix] = '\0';
+ }
strcat (tmpstr + prefix, formatspec->ext);
prefix += strlen(formatspec->ext);
strcat (tmpstr + prefix, cptr + 2);
|