changeset 37025:df052000865c

Check potmeter and pimage default value in skin configuration file. The value has to be in the range of 0 to 100.
author ib
date Thu, 03 Apr 2014 10:16:01 +0000
parents 0790f864cea2
children b6ff1451035d
files gui/skin/skin.c help/help_mp-de.h help/help_mp-en.h
diffstat 3 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/skin.c	Thu Apr 03 09:47:41 2014 +0000
+++ b/gui/skin/skin.c	Thu Apr 03 10:16:01 2014 +0000
@@ -625,6 +625,11 @@
     h   = cutInt(in, ',', 9);
     cutStr(in, buf, ',', 10);
 
+    if (d < 0 || d > 100) {
+        skin_error(MSGTR_GUI_MSG_SkinErrorDefault, d);
+        return 1;
+    }
+
     message = appFindMessage(buf);
 
     if (message == -1) {
@@ -769,6 +774,11 @@
     h   = cutInt(in, ',', 6);
     cutStr(in, buf, ',', 7);
 
+    if (d < 0 || d > 100) {
+        skin_error(MSGTR_GUI_MSG_SkinErrorDefault, d);
+        return 1;
+    }
+
     message = appFindMessage(buf);
 
     if (message == -1) {
--- a/help/help_mp-de.h	Thu Apr 03 09:47:41 2014 +0000
+++ b/help/help_mp-de.h	Thu Apr 03 10:16:01 2014 +0000
@@ -919,6 +919,7 @@
 #define MSGTR_GUI_MSG_SkinCfgNotFound "Skin '%s' nicht gefunden.\n"
 #define MSGTR_GUI_MSG_SkinCfgSelectedNotFound "Ausgewähltes Skin '%s' nicht gefunden, es wird mit Skin 'default' versucht ...\n"
 #define MSGTR_GUI_MSG_SkinErrorBitmap16Bit "Die Farbtiefe von %s beträgt 16 bpp oder weniger, was nicht unterstützt wird.\n"
+#define MSGTR_GUI_MSG_SkinErrorDefault "Vorgabewert (%d) außerhalb des Wertebereichs\n"
 #define MSGTR_GUI_MSG_SkinErrorItem "Dieses Element wird in '%s' nicht unterstützt.\n"
 #define MSGTR_GUI_MSG_SkinErrorMessage "Fehler in der Skin-Konfigurationsdatei in Zeile %d: %s"
 #define MSGTR_GUI_MSG_SkinErrorNumphases "Die Anzahl der Phasen darf nicht null sein.\n"
--- a/help/help_mp-en.h	Thu Apr 03 09:47:41 2014 +0000
+++ b/help/help_mp-en.h	Thu Apr 03 10:16:01 2014 +0000
@@ -710,6 +710,7 @@
 #define MSGTR_GUI_MSG_SkinCfgNotFound "Skin '%s' not found.\n"
 #define MSGTR_GUI_MSG_SkinCfgSelectedNotFound "Selected skin '%s' not found, trying skin 'default'...\n"
 #define MSGTR_GUI_MSG_SkinErrorBitmap16Bit "Color depth of bitmap %s is 16 bits or less which is not supported.\n"
+#define MSGTR_GUI_MSG_SkinErrorDefault "Default (%d) out of range\n"
 #define MSGTR_GUI_MSG_SkinErrorItem "This item is not supported by '%s'.\n"
 #define MSGTR_GUI_MSG_SkinErrorMessage "Error in skin config file at line %d: %s"
 #define MSGTR_GUI_MSG_SkinErrorNumphases "The number of phases must not be zero.\n"