diff main.c @ 83:b9179968a272

- fix set_params (strange) - allow overriding settings in another config file
author Matt Johnston <matt@ucc.asn.au>
date Wed, 11 Jul 2012 23:37:13 +0800
parents 4a2a82d6302c
children 81b8c84344c4
line wrap: on
line diff
--- a/main.c	Wed Jul 11 22:50:23 2012 +0800
+++ b/main.c	Wed Jul 11 23:37:13 2012 +0800
@@ -486,10 +486,9 @@
     {
         cmd_get_params();
     }
-    else if (strncmp_P(readbuf, PSTR("set_params "), 
-                strlen("set_params ") == 0))
+    else if (strncmp_P(readbuf, PSTR("set_params "), 11) == 0)
     {
-        cmd_set_params(&readbuf[strlen("set_params ")]);
+        cmd_set_params(&readbuf[11]);
     }
     else if (strcmp_P(readbuf, PSTR("awake")) == 0)
     {
@@ -501,7 +500,7 @@
     }
     else
     {
-        printf_P(PSTR("Bad command\n"));
+        printf_P(PSTR("Bad command '%s'\n"), readbuf);
     }
 }