summaryrefslogtreecommitdiff
path: root/news/nntpclnt/patches/patch-ad
blob: 6f4275825c9871a48c23d7e53a881d7eb703ef9f (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
$NetBSD: patch-ad,v 1.2 2012/11/19 03:00:14 joerg Exp $

--- inews.c.orig	1994-08-11 21:37:50.000000000 +0000
+++ inews.c
@@ -16,7 +16,14 @@ static char *sccsid = "@(#)$Id: inews.c,
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <ctype.h>
+#include <unistd.h>
+#ifdef USG
+#include <string.h>
+#else /* not USG */
+#include <strings.h>
+#endif /* not USG */
 #include "config.h"
 #include "nntp.h"
 #include "nntpclnt.h"
@@ -27,11 +34,6 @@ extern struct passwd *getpwuid();
 extern struct passwd *getpwnam();
 #endif
 #endif
-#ifdef USG
-#include <string.h>
-#else /* not USG */
-#include <strings.h>
-#endif /* not USG */
 /* for gen_frompath() */
 #define FROM 1
 #define PATH 2
@@ -55,9 +57,14 @@ char *homedir;
 char *fullname;
 #endif
 
-main(argc, argv)
-int	argc;
-char	*argv[];
+void append_signature(void);
+int valid_header(char *);
+int postauth(char *, char *);
+void gen_frompath(int);
+int uname(char *uptr);
+
+int
+main(int argc, char *argv[])
 {
 	char	line[NNTP_STRLEN], s[NNTP_STRLEN];
 	int	seen_fromline, in_header, seen_header, seen_pathline;
@@ -307,7 +314,8 @@ again:
  * The rn-style DOTDIR environmental variable is used if present.
  */
 
-append_signature()
+void
+append_signature(void)
 {
 	char	line[256], sigfile[256];
 	char	*cp;
@@ -390,8 +398,8 @@ append_signature()
  * a From: line in it.
  */
 
-gen_frompath(which)
-int which;
+void
+gen_frompath(int which)
 {
 	char	*s;
 	char	*cp;
@@ -460,7 +468,7 @@ int which;
 				putc(*cp, ser_wr_fp);
 			else {		/* Stupid & hack.  God damn it. */
 				putc(toupper(username[0]), ser_wr_fp);
-				fprintf(ser_wr_fp, username+1);
+				fprintf(ser_wr_fp, "%s", username+1);
 			}
 		fprintf(ser_wr_fp, ")\r\n");
 	}
@@ -484,8 +492,7 @@ int which;
  *
  */
 
-int valid_header(h)
-register char *h;
+int valid_header(char *h)
 {
   char *index();
   char *colon, *space;