ANSI C; sprintf now returns an int.
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 23 Oct 1987 11:42:02 +0000 (03:42 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 23 Oct 1987 11:42:02 +0000 (03:42 -0800)
SCCS-vsn: usr.bin/grep/egrep/egrep.c 5.9
SCCS-vsn: usr.bin/rdist/lookup.c 5.2
SCCS-vsn: usr.bin/window/startup.c 3.19
SCCS-vsn: usr.bin/window/string.c 3.9
SCCS-vsn: usr.bin/window/ww.h 3.43
SCCS-vsn: old/refer/refer/refer..c 4.4
SCCS-vsn: old/refer/sortbib/sortbib.c 4.2

usr/src/old/refer/refer/refer..c
usr/src/old/refer/sortbib/sortbib.c
usr/src/usr.bin/grep/egrep/egrep.c
usr/src/usr.bin/rdist/lookup.c
usr/src/usr.bin/window/startup.c
usr/src/usr.bin/window/string.c
usr/src/usr.bin/window/ww.h

index 33ad823..c0e7b02 100644 (file)
@@ -1,4 +1,4 @@
-/*     refer..c        4.3     86/04/23        */
+/*     refer..c        4.4     87/10/22        */
 
 #include <stdio.h>
 #include <ctype.h>
 
 #include <stdio.h>
 #include <ctype.h>
@@ -40,4 +40,4 @@ extern char *class(),*caps(),*revauth();
 extern char *artskp(),*fpar();
 extern char *trimnl();
 
 extern char *artskp(),*fpar();
 extern char *trimnl();
 
-extern char *getenv(), *sprintf(), *strcpy(), *strcat();
+extern char *getenv(), *strcpy(), *strcat();
index 31dfabb..08c4555 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)sortbib.c   4.1 (Berkeley) %G%";
+static char *sccsid = "@(#)sortbib.c   4.2 (Berkeley) %G%";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -132,7 +132,7 @@ deliver(fp, tfp)    /* deliver sorted entries out of database(s) */
 FILE *fp[], *tfp;
 {
        char str[BUF], buff[BUF*8];     /* for tempfile & databases */
 FILE *fp[], *tfp;
 {
        char str[BUF], buff[BUF*8];     /* for tempfile & databases */
-       char cmd[80], *sprintf();       /* for using system sort command */
+       char cmd[80];                   /* for using system sort command */
        long int offset;
        int i, length;
 
        long int offset;
        int i, length;
 
index 80ea783..22eba34 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)egrep.c    5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)egrep.c    5.9 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -137,7 +137,7 @@ char preamble[200];         /* match prefix (filename, line no.) */
 
 int fd;
 char *
 
 int fd;
 char *
-strchr(), *strrchr(), *strcpy(), *strncpy(), *strpbrk(), *sprintf(), *malloc();
+strchr(), *strrchr(), *strcpy(), *strncpy(), *strpbrk(), *malloc();
 char *
 grepxlat(), *fold(), *pfile(), *alternate(), *isolate();
 char **args;
 char *
 grepxlat(), *fold(), *pfile(), *alternate(), *isolate();
 char **args;
@@ -628,7 +628,7 @@ gotamatch(file, s)
                        if (!squirrel)
                                printf("%s:", file);
                        else
                        if (!squirrel)
                                printf("%s:", file);
                        else
-                               sprintf(preamble, "%s:", file);
+                               (void)sprintf(preamble, "%s:", file);
                if (nflag) {
                        if (prevmatch)
                                prevnline = prevnline + nlcount(prevloc, s);
                if (nflag) {
                        if (prevmatch)
                                prevnline = prevnline + nlcount(prevloc, s);
@@ -639,7 +639,7 @@ gotamatch(file, s)
                        if (!squirrel)
                                printf("%ld:", prevnline);
                        else
                        if (!squirrel)
                                printf("%ld:", prevnline);
                        else
-                               sprintf(preamble + strlen(preamble),
+                               (void)sprintf(preamble + strlen(preamble),
                                        "%ld:", prevnline);
                }
                if (!squirrel) {
                                        "%ld:", prevnline);
                }
                if (!squirrel) {
@@ -819,7 +819,7 @@ isolate(regexpr)            /* isolate longest metacharacter-free string */
         * sees a leading * pattern.  Foo! 
         */
        dummyexpr = malloc((unsigned) strlen(regexpr) + 5);
         * sees a leading * pattern.  Foo! 
         */
        dummyexpr = malloc((unsigned) strlen(regexpr) + 5);
-       sprintf(dummyexpr, "(.)*%s", regexpr);
+       (void)sprintf(dummyexpr, "(.)*%s", regexpr);
        if ((rspencer = regcomp(dummyexpr)) == NULL)
                kernighan(args);
        return (rspencer->regmust);
        if ((rspencer = regcomp(dummyexpr)) == NULL)
                kernighan(args);
        return (rspencer->regmust);
index 908cdaf..ebd135a 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lookup.c   5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lookup.c   5.2 (Berkeley) %G%";
 #endif not lint
 
 #include "defs.h"
 #endif not lint
 
 #include "defs.h"
@@ -113,7 +113,7 @@ lookup(name, action, value)
                        continue;
                if (action != LOOKUP) {
                        if (action != INSERT || s->s_type != CONST) {
                        continue;
                if (action != LOOKUP) {
                        if (action != INSERT || s->s_type != CONST) {
-                               sprintf(buf, "%s redefined", name);
+                               (void)sprintf(buf, "%s redefined", name);
                                yyerror(buf);
                        }
                }
                                yyerror(buf);
                        }
                }
@@ -121,7 +121,8 @@ lookup(name, action, value)
        }
 
        if (action == LOOKUP) {
        }
 
        if (action == LOOKUP) {
-               yyerror(sprintf(buf, "%s undefined", name));
+               (void)sprintf(buf, "%s undefined", name);
+               yyerror(buf);
                return(NULL);
        }
 
                return(NULL);
        }
 
index eece9cb..9530c41 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)startup.c  3.18 %G%";
+static char sccsid[] = "@(#)startup.c  3.19 %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -22,9 +22,10 @@ doconfig()
 
        if ((home = getenv("HOME")) == 0)
                home = ".";
 
        if ((home = getenv("HOME")) == 0)
                home = ".";
-       return dosource(sprintf(buf, "%.*s/%s",
+       sprintf(buf, "%.*s/%s",
                (sizeof buf - sizeof runcom) / sizeof (char) - 1,
                (sizeof buf - sizeof runcom) / sizeof (char) - 1,
-               home, runcom));
+               home, runcom);
+       return dosource(buf);
 }
 
 /*
 }
 
 /*
index dd781fa..4b20089 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)string.c   3.8 %G%";
+static char sccsid[] = "@(#)string.c   3.9 %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -11,7 +11,6 @@ static char sccsid[] = "@(#)string.c  3.8 %G%";
 #include "string.h"
 
 char *malloc();
 #include "string.h"
 
 char *malloc();
-char *sprintf();
 
 char *
 str_cpy(s)
 
 char *
 str_cpy(s)
index 0e9ad54..cbae9e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * @(#)ww.h    3.42 %G%        
+ * @(#)ww.h    3.43 %G%        
  */
 
 /*
  */
 
 /*
@@ -251,7 +251,6 @@ char *tgetstr();
 char *rindex();
 char *strcpy();
 char *strcat();
 char *rindex();
 char *strcpy();
 char *strcat();
-char *sprintf();
 
 #undef MIN
 #undef MAX
 
 #undef MIN
 #undef MAX