]> git.webhop.me Git - lcd4linux.git/commitdiff
stabilize text widget when no string is available; info message when serdisplib canno...
authorvolker <volker@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 13 Feb 2013 13:49:22 +0000 (13:49 +0000)
committervolker <volker@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 13 Feb 2013 13:49:22 +0000 (13:49 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1192 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

drv_serdisplib.c
svn_version.h
widget_text.c

index d4b5542295a5eef8b58d9ed095e0848b7eef95bd..d6fe4b0aac977bfd5740ba2dca93ad501c3eaee1 100644 (file)
@@ -164,6 +164,7 @@ static int drv_SD_start(const char *section)
     sdcd = SDCONN_open(port);
     if (sdcd == NULL) {
        error("%s: open(%s) failed: %s", Name, port, sd_geterrormsg());
+        info("%s: examples:\n  serraw:/dev/ttyS0\n  par:/dev/parport0\n  USB:<vendor>/<product>", Name);
        return -1;
     }
 
index 9d24f768e584bb9e37b46dab51bfdb5f9522f056..5df47cf6c508c6950e6a726435b2b311ee28a588 100644 (file)
@@ -1 +1 @@
-#define SVN_VERSION "1158"
+#define SVN_VERSION "1192"
index 7c1ee7a6eadb8d0e0ab2bfa24f9c571277d3dea2..ee178e6166bcc228a8d25a2a30fc9b5168020388 100644 (file)
 void widget_text_scroll(void *Self)
 {
     WIDGET *W = (WIDGET *) Self;
+    if (NULL == W || NULL == W->data) {
+        error("Warning: internal data error in Textwidget");
+        return;
+    }
     WIDGET_TEXT *T = W->data;
 
     char *prefix = P2S(&T->prefix);
@@ -68,6 +72,10 @@ void widget_text_scroll(void *Self)
     int num, len, width, pad;
     char *src, *dst;
 
+    if (NULL == string) {
+        error("Warning: Widget %s has no string", W->name);
+        return;
+    }
     num = 0;
     len = strlen(string);
     width = T->width - strlen(prefix) - strlen(postfix);