1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Another round of tweaks

Notable changes:
- Change a bunch of uses of memcmp(3) to compare strings (which can
  cause buffer read overflows) to strncmp(3).
- src/cmd/ksh93/include/name.h: Eliminate redundant Nambfp_f type.
  Replace with Shbltin_f type from libast's shcmd.h. Since that is
  not guaranteed to be included here, repeat the type definition
  here without fully defining the struct (which is valid in C).
This commit is contained in:
Martijn Dekker 2022-06-24 15:25:05 +01:00
parent da97587e9e
commit cc1689849e
21 changed files with 47 additions and 50 deletions

View file

@ -131,7 +131,7 @@ static int enuminfo(Opt_t* op, Sfio_t *out, const char *str, Optdisc_t *fp)
return(0);
if(strcmp(str,"default")==0)
sfprintf(out,"\b%s\b",ep->values[0]);
else if(memcmp(str,"last",4)==0)
else if(strncmp(str,"last",4)==0)
{
while(ep->values[++n])
;