equal
deleted
inserted
replaced
37 s = va_arg (list, char *); |
37 s = va_arg (list, char *); |
38 while ((pos + strlen (s)) > (size * BUF_SIZE)) { |
38 while ((pos + strlen (s)) > (size * BUF_SIZE)) { |
39 if ((ptr = realloc (s_str, ++size * BUF_SIZE)) == NULL) { |
39 if ((ptr = realloc (s_str, ++size * BUF_SIZE)) == NULL) { |
40 s_str[pos] = '\0'; |
40 s_str[pos] = '\0'; |
41 fputs (s_str, fp); /* print it anyway... */ |
41 fputs (s_str, fp); /* print it anyway... */ |
|
42 free (s_str); |
42 return EOF; |
43 return EOF; |
43 } |
44 } |
44 s_str = ptr; |
45 s_str = ptr; |
45 } |
46 } |
46 for (i = 0; i < strlen (s); i++) { |
47 for (i = 0; i < strlen (s); i++) { |
65 s_str[pos++] = *fmt++; |
66 s_str[pos++] = *fmt++; |
66 } |
67 } |
67 |
68 |
68 if (pos > (size * BUF_SIZE / 2)) { |
69 if (pos > (size * BUF_SIZE / 2)) { |
69 if ((ptr = realloc (s_str, ++size * BUF_SIZE)) == NULL) { |
70 if ((ptr = realloc (s_str, ++size * BUF_SIZE)) == NULL) { |
|
71 free (s_str); |
70 return EOF; |
72 return EOF; |
71 } |
73 } |
72 s_str = ptr; |
74 s_str = ptr; |
73 } |
75 } |
74 } |
76 } |