delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/31/15:24:45

Xref: news2.mv.net comp.os.msdos.djgpp:2301
From: olly AT mantis DOT co DOT uk (Olly Betts)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug in `_is_executable', with a patch
Date: 31 Mar 1996 17:14:09 +0100
Organization: techn-ol-ogy
Lines: 25
Message-ID: <19960331160925.olly@mantis.co.uk>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 960327181348 DOT 4844T-100000 AT is>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <Pine DOT SUN DOT 3 DOT 91 DOT 960327181348 DOT 4844T-100000 AT is>,
Eli Zaretskii  <eliz AT is DOT elta DOT co DOT il> wrote:
>!       char tmp_buf[6];
>[snip]
>--- 183,197 ----
>        && strlen(extension) <= ((extension[0]=='.') ? 4 : 3))
>      {
>        /* Search the list of extensions in executables[]. */
>!       char tmp_buf[5], *tp = tmp_buf;
>  
>!       *tp++ = '|';
>!       if (*extension == '.')
>! 	extension++;
>!       while (*extension)
>! 	*tp++ = toupper (*extension++);
>!       *tp++ = '|';
>!       *tp = '\0';

I think tmp_buf needs to be (at least) 6 in size.  One for the '|', up to 3
for the extension, another '|', and the terminating '\0' makes 6.

Olly

-- 
cool wet grass  cool wet grass  cool wet grass  cool wet grass  cool wet grass

- Raw text -


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