Don't try to use itoa(), which isn't available on most systems. Instead,

use sprintf().

getUserdataPath() call in test/preferences.cxx reverted to old 1 argument
version.  We only provide the 2-arg version (pointer + length) to enforce
safe programming.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2148 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-05-01 00:03:36 +00:00
parent 288f3e8c7a
commit 45f8282135
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Preferences.cxx,v 1.1.2.8 2002/04/30 22:25:18 matthiaswm Exp $"
// "$Id: Fl_Preferences.cxx,v 1.1.2.9 2002/05/01 00:03:35 easysw Exp $"
//
// Preferences methods for the Fast Light Tool Kit (FLTK).
//
@ -545,7 +545,7 @@ void Fl_Preferences::flush()
Fl_Preferences::Name::Name( unsigned int n )
{
data_ = (char*)malloc(20);
itoa( n, data_, 10 );
sprintf(data_, "%u", n);
}
/**
@ -1084,5 +1084,5 @@ char Fl_Preferences::Node::remove()
//
// End of "$Id: Fl_Preferences.cxx,v 1.1.2.8 2002/04/30 22:25:18 matthiaswm Exp $".
// End of "$Id: Fl_Preferences.cxx,v 1.1.2.9 2002/05/01 00:03:35 easysw Exp $".
//

View File

@ -172,7 +172,7 @@ double doubleValue;
Fl_Preferences app( Fl_Preferences::USER, "fltk.org", "test/preferences" );
char path[ FL_PATH_MAX ];
app.getUserdataPath( path );
app.getUserdataPath( path, sizeof(path) );
Fl_Preferences bed( app, "Bed" );
bed.get( "alarm", buffer, "8:00", 80 );