| 1 | Patchvsubmitted as pull request: |
| 2 | |
| 3 | https://github.com/LonnyGomes/hexcurse/pull/18 |
| 4 | |
| 5 | diff -u -r ../hexcurse-hexcurse-1.58/src/getopt.c ./src/getopt.c |
| 6 | --- ../hexcurse-hexcurse-1.58/src/getopt.c 2014-02-26 19:26:34.000000000 -0500 |
| 7 | +++ ./src/getopt.c 2015-08-23 07:53:55.917711262 -0400 |
| 8 | @@ -32,16 +32,6 @@ |
| 9 | #undef optind |
| 10 | #undef alloca |
| 11 | |
| 12 | -/* The following modification was submited by Claudio Fanin. This change * |
| 13 | - * enables hexcurse to be compiled with SGI's proprietary compiler */ |
| 14 | -#ifdef _SGIAPI |
| 15 | -#include <alloca.h> |
| 16 | -#endif |
| 17 | -#ifndef __alloca |
| 18 | -#define __alloca alloca |
| 19 | -#endif |
| 20 | -/* end of modification */ |
| 21 | - |
| 22 | #ifdef HAVE_OPTIND |
| 23 | extern char* optarg; |
| 24 | #else |
| 25 | @@ -85,7 +75,7 @@ |
| 26 | char **argv; |
| 27 | { |
| 28 | int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *); |
| 29 | - char **temp = (char **) __alloca (nonopts_size); |
| 30 | + char **temp = (char **) malloc(nonopts_size); |
| 31 | |
| 32 | /* Interchange the two blocks of data in ARGV. */ |
| 33 | |
| 34 | @@ -95,6 +85,7 @@ |
| 35 | my_bcopy ((char *) temp, |
| 36 | (char *) &argv[first_nonopt + optind - last_nonopt], |
| 37 | nonopts_size); |
| 38 | + free(temp); |
| 39 | |
| 40 | /* Update records for the slots the non-options now occupy. */ |
| 41 | |