Fix potential invalid stack variable access in test code
This code was (and is still) commented out but it *would* trigger a "stack buffer overflow" error *if* uncommented. The new code demonstrates how a binary object (Fl_Preferences 'bed') can be dumped to a preferences file in binary format (if activated).
This commit is contained in:
parent
43ff6f0c32
commit
226a4ea784
@ -471,7 +471,10 @@ Function {writePrefs()} {open return_type void
|
||||
fl_message( "Assertion failed:\\nNot all group entries were found!" );
|
||||
|
||||
/* sample code only: */
|
||||
//unsigned int hex = 0x2387efcd;
|
||||
//eat.set( "binFoo", (void*)&hex, sizeof( unsigned int ) );
|
||||
//eat.set( "binFoo2", (void*)&bed, 256 );} {}
|
||||
// unsigned int hex = 0xefbeadde;
|
||||
// unsigned int size_of_bed = sizeof( bed ); // size of Fl_Preferences 'bed'
|
||||
// eat.set( "binFoo", (void*)&hex, sizeof( unsigned int ) );
|
||||
// eat.set( "SizeOfBed", (int)size_of_bed );
|
||||
// eat.set( "Prefs_Bed", (void*)&bed, sizeof( bed ) );} {selected
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user