Chameleon

Chameleon Commit Details

Date:2015-03-11 15:17:36 (9 years 1 month ago)
Author:ErmaC
Commit:2611
Parents: 2610
Message:snprintf instead of sprintf
Changes:
M/trunk/i386/modules/Keylayout/Keylayout.c
M/trunk/i386/libsaio/disk.c
M/trunk/i386/libsaio/nbp.c

File differences

trunk/i386/libsaio/nbp.c
107107
108108
109109
110
110
111111
112112
113113
static void NBPGetDescription(CICell ih, char * str, long strMaxLen)
{
sprintf( str, "Ethernet PXE Client" );
snprintf( str, strMaxLen, "Ethernet PXE Client" );
}
//==========================================================================
trunk/i386/libsaio/disk.c
263263
264264
265265
266
266
267267
268268
269269
......
17251725
17261726
17271727
1728
1728
17291729
17301730
17311731
......
17351735
17361736
17371737
1738
1738
17391739
17401740
17411741
......
17441744
17451745
17461746
1747
1747
17481748
17491749
17501750
......
17841784
17851785
17861786
1787
1787
17881788
17891789
17901790
......
17961796
17971797
17981798
1799
1799
18001800
18011801
18021802
......
18361836
18371837
18381838
1839
1839
18401840
18411841
18421842
......
21912191
21922192
21932193
2194
2194
21952195
21962196
21972197
......
23412341
23422342
23432343
2344
2344
23452345
23462346
23472347
......
23502350
23512351
23522352
2353
2353
23542354
23552355
23562356
return errname;
}
sprintf(errorstr, "Error 0x%02x", errnum);
snprintf(errorstr, sizeof(errorstr), "Error 0x%02x", errnum);
return errorstr; // No string, print error code only
}
if (!valid)
{
// OS X Standard
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
else
{
// OS X Server
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
}
/*else
{
sprintf(dirSpec, "hd(%d,%d)/.IAProductInfo", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/.IAProductInfo", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
if(!valid)
{
int fh = -1;
sprintf(dirSpec, "hd(%d,%d)/.PhysicalMediaInstall", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/.PhysicalMediaInstall", BIOS_DEV_UNIT(bvr), bvr->part_no);
fh = open(dirSpec, 0);
if (fh >= 0)
}
else
{
sprintf(dirSpec, "hd(%d,%d)/.IAPhysicalMedia", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/.IAPhysicalMedia", BIOS_DEV_UNIT(bvr), bvr->part_no);
fh = open(dirSpec, 0);
if (fh >= 0)
//
if (bvr->flags & kBVFlagBooter)
{
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/System/Library/CoreServices/", BIOS_DEV_UNIT(bvr), bvr->part_no);
strcpy(fileSpec, ".disk_label.contentDetails");
ret = GetFileInfo(dirSpec, fileSpec, &flags, &time);
if (!ret)
}
// Try to match hd(x,y) first.
sprintf(testStr, "hd(%d,%d)", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(testStr, sizeof(testStr), "hd(%d,%d)", BIOS_DEV_UNIT(bvr), bvr->part_no);
if ( matchLen ? !strncmp(match, testStr, matchLen) : !strcmp(match, testStr) )
{
return true;
if (name == NULL)
{
sprintf(p, "TYPE %02X", type);
snprintf(p, strMaxLen, "TYPE %02X", type);
}
else
{
}
// Set the devices label
sprintf(bvr->label, p);
snprintf(bvr->label, sizeof(bvr->label), p);
}
trunk/i386/modules/Keylayout/Keylayout.c
138138
139139
140140
141
141
142142
143143
144144
if (getValueForKey("KeyLayout", &val, &len, &bootInfo->chameleonConfig))
{
sprintf(layoutPath, "/Extra/Keymaps/%s", val);
snprintf(layoutPath, sizeof(layoutPath),"/Extra/Keymaps/%s", val);
// Add the extension if needed
if (len <= 4 || strcmp(val+len-4,".lyt") != 0)
strncat(layoutPath, ".lyt", sizeof(layoutPath) - strlen(layoutPath) - 1);

Archive Download the corresponding diff file

Revision: 2611