On Mon, 22 Jul 2002, Richard Levitte - VMS Whacker via RT wrote:
> I understand, however, why you made that change, now that I looked a
> little more closely at the rest of the changes. I made the following
> change to your change:
>
> --- /home/levitte/dist/dummytest.c 2002-07-22 18:08:01.000000000 +0200
> +++ test/dummytest.c 2002-07-22 18:11:18.000000000 +0200
> @@ -19,6 +19,7 @@
> if (!p) p = strrchr(argv[0], ':');
> q = 0;
> #endif
> + if (p) p++;
> if (!p) p = argv[0];
> if (p) q = strchr(p, '.');
> if (p && !q) q = p + strlen(p);
> @@ -27,8 +28,9 @@
> program = BUF_strdup("(unknown)");
> else
> {
> - program = OPENSSL_malloc(strlen(p) + 1);
> - strcpy(program, p);
> + program = OPENSSL_malloc(q - p + 1);
> + strncpy(program, p, q - p);
> + program[q - p] = '\0';
> }
>
> for(p = program; *p; p++)
> @@ -38,7 +40,7 @@
> if (q > p && q[-1] == '_') q--;
> *q = '\0';
>
> - printf("No %s support\n", program + 1);
> + printf("No %s support\n", program);
>
> OPENSSL_free(program);
> return(0);
With these changes I get the same error that made me try to change the
code initially. I copied dummytest.c to ideatest.c and ran make. GCC
doesn't like "program = OPENSSL_malloc(q - p +1);":
making all in test...
make.exe[1]: Entering directory
`d:/djgpp/ssl97-0720/openssl-0.9.7-stable-SNAP-20020720/test'
gcc -I.. -I../include -DOPENSSL_SYSNAME_MSDOS -DOPENSSL_NO_KRB5 -DOPENSSL_NO_RC5
-DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -I/dev/env/DJDIR/watt32/inc -DTERMIOS -DL_ENDIAN
-fomit-frame-pointer -O2 -Wall -c -o ideatest.o ideatest.c
ideatest.c: In function `main':
ideatest.c:31: invalid operands to binary -
make.exe[1]: *** [ideatest.o] Error 1
make.exe[1]: Leaving directory
`d:/djgpp/ssl97-0720/openssl-0.9.7-stable-SNAP-20020720/test'
make.exe: *** [sub_all] Error 1
Doug
__
Doug Kaufman
Internet: [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]