Chameleon

Chameleon Commit Details

Date:2011-08-14 07:36:43 (12 years 7 months ago)
Author:Evan Lojewski
Commit:1366
Parents: 1365
Message:Cause getValueForBootKey to return a new string, instead of a pointer to the cmdline
Changes:
M/trunk/i386/libsaio/stringTable.c

File differences

trunk/i386/libsaio/stringTable.c
323323
324324
325325
326
326
327
328
329
330
331
327332
328333
329334
330335
331336
337
338
332339
333340
334341
}
if ((strlen(match) == key_len)
&& strncmp(match, key, key_len) == 0) {
*matchval = value;
// create a new string
char* newstr = malloc(value_len + 1);
strncpy(newstr, value, value_len);
newstr[value_len] = 0;
*matchval = newstr;
*len = value_len;
retval = true;
/* Continue to look for this key; last one wins. */
}
}
return retval;
}

Archive Download the corresponding diff file

Revision: 1366