delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/06/13/18:32:48

Message-ID: <3946A93A.8805F454@softhome.net>
Date: Wed, 14 Jun 2000 00:35:54 +0300
From: Laurynas Biveinis <lauras AT softhome DOT net>
X-Mailer: Mozilla 4.73 [en] (Win98; U)
X-Accept-Language: lt,en
MIME-Version: 1.0
To: DJGPP Workers <djgpp-workers AT delorie DOT com>
Subject: A fix for warning in dosexec.c
Reply-To: djgpp-workers AT delorie DOT com

A side effect of symlink development - 
This patch fixes warning in script_exec()
where signed int i is used in

 for (i=0; i < sizeof(line)-1 && line[i] != '\0'; i++)
   if (line[i] < 7 && line[i] >= 0)
     return direct_exec(program, argv, envp);

i is compared with sizeof(line) which is unsigned.

OK to commit?

Laurynas

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/13 22:28:37
@@ -813,7 +813,8 @@
   char line[130], interp[FILENAME_MAX], iargs[130];
   FILE *f;
   char **newargs;
-  int i, hasargs=0;
+  int hasargs=0;
+  unsigned int i;
   char *base, *p;
   int has_extension = 0, has_drive = 0;
   char pinterp[FILENAME_MAX];

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019