From: Jon Trulson Date: Thu, 9 Aug 2012 18:21:43 +0000 (-0600) Subject: At least on OpenBSD/amd64, this macro returns a bogus value if its argument is NULL. X-Git-Tag: 2.2.0b~83^2~53 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0d2f7866ac676ab0f3c8ac3eabcec06f580a9d62;p=oweals%2Fcde.git At least on OpenBSD/amd64, this macro returns a bogus value if its argument is NULL. Patch from Pascal Stumpf So check for this first like the other macros in this file do, and don't cast an istring to int. --- diff --git a/cde/programs/dtappbuilder/src/libAButil/istr.h b/cde/programs/dtappbuilder/src/libAButil/istr.h index fead77a6..35828148 100644 --- a/cde/programs/dtappbuilder/src/libAButil/istr.h +++ b/cde/programs/dtappbuilder/src/libAButil/istr.h @@ -272,7 +272,7 @@ extern ISTR_PRIVT_STRN *istrP_int_array1809065681PrivD; #define istr_string_safe(s) ((s) == NULL? Istr_null_string:istr_string(s)) #define istrP_get_string_fast3718930164PrivF(istring) \ - (istrP_int_array1809065681PrivD[((int)istring)].str) + ((istring)==NULL ? Istr_null_string : (istrP_int_array1809065681PrivD[((long)istring)].str)) /* istr_string - if debugging is turned on, checks ISTRINGS for validity */ #ifdef DEBUG