From ceeb2aad23b3bc8b73cecf5a46f21d476698b06d Mon Sep 17 00:00:00 2001 From: GravisZro Date: Mon, 6 Feb 2017 13:26:43 -0500 Subject: [PATCH] now loads on Linux! (used to have \r at the end of filepaths) --- WishPiX/Prefs/prefs.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/WishPiX/Prefs/prefs.cpp b/WishPiX/Prefs/prefs.cpp index dae9319..d22ff03 100644 --- a/WishPiX/Prefs/prefs.cpp +++ b/WishPiX/Prefs/prefs.cpp @@ -284,9 +284,8 @@ int16_t RPrefs::Read() // Returns 0 if successfull, non-zero otherwise } // Remove newline (if any) from end of line - int16_t len = strlen(pszFixedLine); - if (pszFixedLine[len - 1] == '\n') - pszFixedLine[len - 1] = '\0'; + for(size_t len = strlen(pszFixedLine) - 1; len && (pszFixedLine[len] == '\n' || pszFixedLine[len] == '\r'); --len) + pszFixedLine[len] = '\0'; // Find first non-space char char* pszToken = pszFixedLine;