blob: 4f2d17fb84a305260bf33df1a9adb725bf1fa762 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
--- ./pbm/pbmtext.c.orig Wed Oct 27 03:27:04 1993
+++ ./pbm/pbmtext.c Sat Jul 20 21:48:12 1996
@@ -105,10 +105,12 @@
else
{ /* Read text from stdin. */
lines = 0;
- while ( gets( buf ) != NULL )
+ while ( fgets( buf, sizeof(buf), stdin ) != NULL )
{
int l;
+ char *nl = strchr(buf, '\n');
+ if (nl) *nl = 0;
fix_control_chars( buf );
l = strlen( buf );
if ( lines >= maxlines )
|