summaryrefslogtreecommitdiffstats
path: root/comms/zmtx-zmrx/files/patch-zmrx.c
blob: 5933b05db770b090f657b1e9e56f7b8fa9283bf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- ./zmrx.c.orig	1996-12-11 23:24:08.000000000 -0800
+++ ./zmrx.c	2011-07-22 17:33:19.603250928 -0700
@@ -15,6 +15,7 @@
 
 #include <ctype.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <string.h>
@@ -70,7 +71,7 @@
 
 	cps = ftell(fp) / duration;
 
-	fprintf(stderr,"zmrx: receiving file \"%s\" %8ld bytes (%3d %%/%5d cps)           \r",
+	fprintf(stderr,"receiving file \"%s\" %8ld bytes (%3d %%/%5d cps)\r",
 		name,ftell(fp),percentage,cps);
 }
 
@@ -223,7 +224,7 @@
 	}
 
 	if (opt_v) {
-		fprintf(stderr,"zmrx: receiving file \"%s\"\r",name);
+		fprintf(stderr,"receiving file \"%s\"\r",name);
 	}
 
 	sscanf(rx_data_subpacket + strlen(rx_data_subpacket) + 1,
@@ -243,6 +244,7 @@
 		fstat(fileno(fp),&s);
 
 		fclose(fp);
+		fp = NULL;
 	}
 	else {
 		exists = FALSE;
@@ -342,7 +344,7 @@
 	 */
 
 	if (opt_v) {
-		fprintf(stderr,"zmrx: received file \"%s\"                 \n",name);
+		fprintf(stderr,"zmrx: received file \"%s\"\n",name);
 	}
 }
 
@@ -386,8 +388,6 @@
 	printf("	-q          quiet\n");
 	printf("	(only one of -n -c or -p may be specified)\n");
 
-	cleanup();
-
 	exit(1);
 }
 
OpenPOWER on IntegriCloud