comparison lib-src/yow.c @ 49600:23a1cea22d13

Trailing whitespace deleted.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 04 Feb 2003 14:56:31 +0000
parents 644c7fb7d69d
children dc31cb80909b d7ddb3e565de
comparison
equal deleted inserted replaced
49599:5ade352e8d1c 49600:23a1cea22d13
1 /* 1 /*
2 * yow.c 2 * yow.c
3 * 3 *
4 * Print a quotation from Zippy the Pinhead. 4 * Print a quotation from Zippy the Pinhead.
5 * Qux <Kaufman-David@Yale> March 6, 1986 5 * Qux <Kaufman-David@Yale> March 6, 1986
6 * 6 *
7 * This file is in the public domain because the author published it 7 * This file is in the public domain because the author published it
8 * with no copyright notice before the US signed the Bern Convention. 8 * with no copyright notice before the US signed the Bern Convention.
9 * 9 *
10 * With dynamic memory allocation. 10 * With dynamic memory allocation.
11 */ 11 */
12 12
13 #ifdef HAVE_CONFIG_H 13 #ifdef HAVE_CONFIG_H
14 #include <config.h> 14 #include <config.h>
112 } 112 }
113 } 113 }
114 header_len = ftell(fp); 114 header_len = ftell(fp);
115 if (header_len > AVG_LEN) 115 if (header_len > AVG_LEN)
116 header_len -= AVG_LEN; /* allow the first quotation to appear */ 116 header_len -= AVG_LEN; /* allow the first quotation to appear */
117 117
118 if (fseek(fp, 0L, 2) == -1) { 118 if (fseek(fp, 0L, 2) == -1) {
119 perror("yow"); 119 perror("yow");
120 exit(1); 120 exit(1);
121 } 121 }
122 len = ftell(fp) - header_len; 122 len = ftell(fp) - header_len;
165 } 165 }
166 166
167 buf[i++] = c; 167 buf[i++] = c;
168 while ((c = getc(fp)) != SEP && c != EOF) { 168 while ((c = getc(fp)) != SEP && c != EOF) {
169 buf[i++] = c; 169 buf[i++] = c;
170 170
171 if (i == bufsize-1) { 171 if (i == bufsize-1) {
172 /* Yow! Is this quotation too long yet? */ 172 /* Yow! Is this quotation too long yet? */
173 bufsize *= 2; 173 bufsize *= 2;
174 buf = realloc(buf, bufsize); 174 buf = realloc(buf, bufsize);
175 if (buf == (char *)0) { 175 if (buf == (char *)0) {