From 68e6e95312bd4499495b93213b0957360da7fb5b Mon Sep 17 00:00:00 2001 From: Ian MacArthur Date: Tue, 14 Oct 2014 12:10:18 +0000 Subject: Adjust the Fl_Preferences method char Fl_Preferences::RootNode::getPath( char *path, int pathlen ) so that it returns a (1), rather than a (-1) in the case that RUNTIME preferences are being read. This is for several reasons: - On some platforms, char is unsigned, so a method that is spec'd to return a char type can not safely return (-1) as a value. - It seems like (most?) other fltk methods that return char true/false results return 0 or 1, so this is more consistent. Thanks to Michael Baeuerle for spotting this one. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10378 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Preferences.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 99ab3a917..ad34ee2ed 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -1216,7 +1216,7 @@ int Fl_Preferences::RootNode::write() { // get the path to the preferences directory char Fl_Preferences::RootNode::getPath( char *path, int pathlen ) { if (!filename_) // RUNTIME preferences - return -1; + return 1; // return 1 (not -1) to be consistent with fl_make_path() strlcpy( path, filename_, pathlen); char *s; -- cgit v1.2.3