diff --git a/flips-gtk.cpp b/flips-gtk.cpp index d38401f..b252661 100644 --- a/flips-gtk.cpp +++ b/flips-gtk.cpp @@ -1,6 +1,6 @@ //Module name: Floating IPS, GTK+ frontend //Author: Alcaro -//Date: See Git timestamps +//Date: See Git history //Licence: GPL v3.0 or higher //List of assumptions made whose correctness is not guaranteed by GTK+: diff --git a/flips.cpp b/flips.cpp index 6c3038f..439e6b7 100644 --- a/flips.cpp +++ b/flips.cpp @@ -251,7 +251,7 @@ void config::set(LPCWSTR name, LPCWSTR value) if (!wcscmp(name, this->names[i])) { free(this->values[i]); - this->values[i] = wcsdup(value); + this->values[i] = (value!=NULL ? wcsdup(value) : NULL); return; } } @@ -292,7 +292,10 @@ LPWSTR config::flatten() at += wsprintf(at, "%s", header); for (size_t i=0;inumentries;i++) { - at += wsprintf(at, "%s=%s\n", this->names[i], this->values[i]); + if (this->values[i]!=NULL) + { + at += wsprintf(at, "%s=%s\n", this->names[i], this->values[i]); + } } return ret; diff --git a/flips.h b/flips.h index 54fb7b3..8f86bae 100644 --- a/flips.h +++ b/flips.h @@ -1,6 +1,6 @@ //Module name: Floating IPS, header for all frontends //Author: Alcaro -//Date: June 18, 2015 +//Date: See Git history //Licence: GPL v3.0 or higher //Preprocessor switch documentation: @@ -69,9 +69,9 @@ #include //Flips uses Windows type names internally, since it's easier to #define them to Linux types than -//defining "const char *" to anything else. Inventing my own typedefs seems counterproductive as -//well; they would bring no advantage over Windows typenames except not being Windows typenames, and -//I don't see that as a valid argument. +//defining "const char *" to anything else. I could invent my own typedefs, but the only advantage +//that would bring over Windows types would be not being Windows types, and I don't see that as a +//valid argument. #define LPCWSTR const char * #define LPWSTR char * diff --git a/global.h b/global.h index 20d548a..1e03c83 100644 --- a/global.h +++ b/global.h @@ -1,6 +1,6 @@ //Module name: Floating IPS, global header //Author: Alcaro -//Date: June 18, 2015 +//Date: See Git history //Licence: GPL v3.0 or higher #ifndef struct_mem