summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan MacArthur <imacarthur@gmail.com>2014-10-14 12:10:18 +0000
committerIan MacArthur <imacarthur@gmail.com>2014-10-14 12:10:18 +0000
commit68e6e95312bd4499495b93213b0957360da7fb5b (patch)
treeb1cd70b993b48667662d28b10c8f7114ea9891c1 /src
parentd24a6b2633664959d0b0ab5fd1ab3aa140ab877f (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Preferences.cxx2
1 files changed, 1 insertions, 1 deletions
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;