ruby-changes:13800
From: yugui <ko1@a...>
Date: Sat, 31 Oct 2009 22:16:57 +0900 (JST)
Subject: [ruby-changes:13800] Ruby:r25597 (ruby_1_9_1): merges r24839 from trunk into ruby_1_9_1.
yugui 2009-10-31 22:05:32 +0900 (Sat, 31 Oct 2009) New Revision: 25597 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25597 Log: merges r24839 from trunk into ruby_1_9_1. -- * dln.c (aix_loaderror): get rid of using uninitialized value in the case loadquery fails. fixed wrong index variable usage. see [ruby-core:25479]. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/dln.c branches/ruby_1_9_1/version.h Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 25596) +++ ruby_1_9_1/ChangeLog (revision 25597) @@ -1,3 +1,9 @@ +Fri Sep 11 09:45:11 2009 Nobuyoshi Nakada <nobu@r...> + + * dln.c (aix_loaderror): get rid of using uninitialized value in the + case loadquery fails. fixed wrong index variable usage. see + [ruby-core:25479]. + Fri Sep 11 01:14:00 2009 Marc-Andre Lafortune <ruby-core@m...> * lib/net/http.rb (fetch): rdoc fix, patch by Arthur Schreiber. Index: ruby_1_9_1/dln.c =================================================================== --- ruby_1_9_1/dln.c (revision 25596) +++ ruby_1_9_1/dln.c (revision 25597) @@ -1155,10 +1155,10 @@ static void aix_loaderror(const char *pathname) { - char *message[8], errbuf[1024]; + char *message[1024], errbuf[1024]; int i,j; - struct errtab { + static const struct errtab { int errnum; char *errstr; } load_errtab[] = { @@ -1179,15 +1179,16 @@ #define LOAD_ERRTAB_LEN (sizeof(load_errtab)/sizeof(load_errtab[0])) #define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1) - snprintf(errbuf, 1024, "load failed - %s ", pathname); + snprintf(errbuf, sizeof(errbuf), "load failed - %s ", pathname); - if (!loadquery(1, &message[0], sizeof(message))) + message[0] = NULL; + if (!loadquery(L_GETMESSAGE, &message[0], sizeof(message))) ERRBUF_APPEND(strerror(errno)); for(i = 0; message[i] && *message[i]; i++) { int nerr = atoi(message[i]); for (j=0; j<LOAD_ERRTAB_LEN; j++) { - if (nerr == load_errtab[i].errnum && load_errtab[i].errstr) - ERRBUF_APPEND(load_errtab[i].errstr); + if (nerr == load_errtab[j].errnum && load_errtab[j].errstr) + ERRBUF_APPEND(load_errtab[j].errstr); } while (isdigit(*message[i])) message[i]++; ERRBUF_APPEND(message[i]); Index: ruby_1_9_1/version.h =================================================================== --- ruby_1_9_1/version.h (revision 25596) +++ ruby_1_9_1/version.h (revision 25597) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 322 +#define RUBY_PATCHLEVEL 323 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/