--- a/src/hello-dmx.c Fri Apr 11 19:51:19 2014 +0300
+++ b/src/hello-dmx.c Fri Apr 11 20:46:25 2014 +0300
@@ -140,12 +140,17 @@
return '!';
}
+ if (end >= DMX_COUNT) {
+ return '!';
+ }
+
// apply
// arg is 1..256
byte c = start - 1;
- for ( ; c < end && c < DMX_COUNT - 1; ) {
- for (byte a = 2; a < console.argc && c < DMX_COUNT - 1; a++) {
+ // c < end actually means inclusive to end of range, as the index is -1
+ for ( ; c < end; ) {
+ for (byte a = 2; a < console.argc && c < end; a++) {
dmx.out[c++] = console.argv[a];
}
}