From 263fb160194ace775f3ddc668682257f14b100cf Mon Sep 17 00:00:00 2001 From: Dick Marinus Date: Mon, 6 Jun 2016 20:57:11 +0200 Subject: [PATCH] glibc fixes I don't know how this can work on the Arduino. strtok_r returns a null pointer if there are no more tokens and str[0] seems to be poking around in that null pointer. --- firmwares/xybot/xybot.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/firmwares/xybot/xybot.ino b/firmwares/xybot/xybot.ino index dc4535c..318a8da 100644 --- a/firmwares/xybot/xybot.ino +++ b/firmwares/xybot/xybot.ino @@ -217,6 +217,7 @@ void parseCordinate(char * cmd) tarY = curY; while(str!=NULL){ str = strtok_r(0, " ", &tmp); + if (str==NULL) break; if(str[0]=='X'){ tarX = atof(str+1); }else if(str[0]=='Y'){