Mail Archives: djgpp-workers/2000/06/14/02:08:18
DJ Delorie wrote:
>
> > i is compared with sizeof(line) which is unsigned.
> >
> > OK to commit?
>
> No, because later that same i is used to hold the return value of the
> function, which is a signed int. How about creating a new unsigned
> variable `u' or something like that?
Like following?
Index: src/libc/dos/process/dosexec.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dos/process/dosexec.c,v
retrieving revision 1.6
diff -u -r1.6 dosexec.c
--- dosexec.c 2000/05/31 17:53:46 1.6
+++ dosexec.c 2000/06/14 06:05:02
@@ -814,6 +814,7 @@
FILE *f;
char **newargs;
int i, hasargs=0;
+ unsigned int ln;
char *base, *p;
int has_extension = 0, has_drive = 0;
char pinterp[FILENAME_MAX];
@@ -832,8 +833,8 @@
return go32_exec(program, argv, envp);
/* Paranoia: is this at all a text file? */
- for (i=0; i < sizeof(line)-1 && line[i] != '\0'; i++)
- if (line[i] < 7 && line[i] >= 0)
+ for (ln=0; ln < sizeof(line)-1 && line[ln] != '\0'; ln++)
+ if (line[ln] < 7 && line[ln] >= 0)
return direct_exec(program, argv, envp);
iargs[0] = 0;
- Raw text -