File suck-4.3.0-fgets.patch of Package suck

--- lpost.c
+++ lpost.c
@@ -13,7 +13,8 @@
 
 int main(int argc,char *argv[]) {
 	FILE *pfp=NULL;
-	char line[1024];
+	const int max_len = 1024;
+	char line[max_len];
 	int count=0,verbose=0, retval=0;
 	size_t len;
 
@@ -21,7 +22,7 @@
 		verbose=1;
 	}
 
-	while(gets(line) != NULL && retval == 0) {
+	while(fgets(line, max_len, stdin) != NULL && retval == 0) {
   		len=strlen(line);
 		if (pfp == NULL) {
 			if (verbose != 0) {
@@ -45,7 +46,6 @@
 		}
 		else {
 			(void) fputs(line, pfp);
-			(void) putc('\n', pfp);
 		}
 	} /* end while */
 	exit(retval);
openSUSE Build Service is sponsored by