diff options
author | 2003-05-16 19:58:57 +0000 | |
---|---|---|
committer | 2003-05-16 19:58:57 +0000 | |
commit | 9e5256b40dc05e06f10225d61bfee63b2e09ab6c (patch) | |
tree | e313d154b15c1cc01349d79d771224155d2370b5 | |
parent | Provide most if not all the support required for the usb changes Nate (diff) | |
download | wireguard-openbsd-9e5256b40dc05e06f10225d61bfee63b2e09ab6c.tar.xz wireguard-openbsd-9e5256b40dc05e06f10225d61bfee63b2e09ab6c.zip |
fix several constant overflows, remove the strerror prototype (shouldn't be
there), and cleanup some whitespace; help from, and okay millert@
-rw-r--r-- | bin/ksh/history.c | 6 | ||||
-rw-r--r-- | bin/ksh/proto.h | 3 | ||||
-rw-r--r-- | bin/ksh/sh.h | 15 |
3 files changed, 6 insertions, 18 deletions
diff --git a/bin/ksh/history.c b/bin/ksh/history.c index 2571f70b6ce..3d9aecb02e0 100644 --- a/bin/ksh/history.c +++ b/bin/ksh/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.19 2003/04/15 08:35:34 deraadt Exp $ */ +/* $OpenBSD: history.c,v 1.20 2003/05/16 19:58:57 jsyn Exp $ */ /* * command history @@ -1096,7 +1096,7 @@ writehistfile(lno, cmd) unsigned char *base; unsigned char *new; int bytes; - char hdr[5]; + unsigned char hdr[5]; (void) flock(histfd, LOCK_EX); sizenow = lseek(histfd, 0L, SEEK_END); @@ -1160,7 +1160,7 @@ static int sprinkle(fd) int fd; { - static char mag[] = { HMAGIC1, HMAGIC2 }; + static unsigned char mag[] = { HMAGIC1, HMAGIC2 }; return(write(fd, mag, 2) != 2); } diff --git a/bin/ksh/proto.h b/bin/ksh/proto.h index 42a0427aa50..d0b7e8a4638 100644 --- a/bin/ksh/proto.h +++ b/bin/ksh/proto.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.h,v 1.10 2003/04/16 23:11:52 tdeval Exp $ */ +/* $OpenBSD: proto.h,v 1.11 2003/05/16 19:58:57 jsyn Exp $ */ /* * prototypes for PD-KSH @@ -189,7 +189,6 @@ void change_flag ARGS((enum sh_flag f, int what, int newval)); int parse_args ARGS((char **argv, int what, int *setargsp)); int getn ARGS((const char *as, int *ai)); int bi_getn ARGS((const char *as, int *ai)); -char * strerror ARGS((int i)); int gmatch ARGS((const char *s, const char *p, int isfile)); int has_globbing ARGS((const char *xp, const char *xpe)); const unsigned char *pat_scan ARGS((const unsigned char *p, diff --git a/bin/ksh/sh.h b/bin/ksh/sh.h index 4e8c4ac83ca..83975878773 100644 --- a/bin/ksh/sh.h +++ b/bin/ksh/sh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sh.h,v 1.12 2002/10/07 23:09:32 vincent Exp $ */ +/* $OpenBSD: sh.h,v 1.13 2003/05/16 19:58:57 jsyn Exp $ */ /* * Public Domain Bourne/Korn shell @@ -14,7 +14,6 @@ # define ARGS(args) () /* K&R declaration */ #endif - /* Start of common headers */ #include <stdio.h> @@ -362,7 +361,7 @@ typedef INT32 Tflag; * not a char that is used often. Also, can't use the high bit as it causes * portability problems (calling strchr(x, 0x80|'x') is error prone). */ -#define MAGIC (7)/* prefix for *?[!{,} during expand */ +#define MAGIC (7) /* prefix for *?[!{,} during expand */ #define ISMAGIC(c) ((unsigned char)(c) == MAGIC) #define NOT '!' /* might use ^ (ie, [!...] vs [^..]) */ @@ -378,11 +377,9 @@ EXTERN int exstat; /* exit status */ EXTERN int subst_exstat; /* exit status of last $(..)/`..` */ EXTERN const char *safe_prompt; /* safe prompt if PS1 substitution fails */ - /* * Area-based allocation built on malloc/free */ - typedef struct Area { struct link *freelist; /* free list */ } Area; @@ -405,7 +402,6 @@ EXTERN Area aperm; /* permanent object space */ # define kshdebug_dump(a) #endif /* KSH_DEBUG */ - /* * parsing & execution environment */ @@ -452,7 +448,6 @@ EXTERN struct env { #define LSHELL 8 /* return to interactive shell() */ #define LAEXPR 9 /* error in arithmetic expression */ - /* option processing */ #define OF_CMDLINE 0x01 /* command line */ #define OF_SET 0x02 /* set builtin */ @@ -598,7 +593,6 @@ EXTERN int volatile fatal_trap;/* received a fatal signal */ extern Trap sigtraps[SIGNALS+1]; #endif /* !FROM_TRAP_C */ - #ifdef KSH /* * TMOUT support @@ -613,11 +607,9 @@ EXTERN unsigned int ksh_tmout; EXTERN enum tmout_enum ksh_tmout_state I__(TMOUT_EXECUTING); #endif /* KSH */ - /* For "You have stopped jobs" message */ EXTERN int really_exit; - /* * fast character classes */ @@ -640,7 +632,6 @@ extern short ctypes []; EXTERN int ifs0 I__(' '); /* for "$*" */ - /* Argument parsing for built-in commands and getopts command */ /* Values for Getopt.flags */ @@ -666,7 +657,6 @@ typedef struct { EXTERN Getopt builtin_opt; /* for shell builtin commands */ EXTERN Getopt user_opt; /* parsing state for getopts builtin command */ - #ifdef KSH /* This for co-processes */ @@ -710,7 +700,6 @@ EXTERN int x_cols I__(80); /* tty columns */ # define x_cols 80 /* for pr_menu(exec.c) */ #endif - /* These to avoid bracket matching problems */ #define OPAREN '(' #define CPAREN ')' |