Skip to content

Commit

Permalink
fix time phrasing nul character bug
Browse files Browse the repository at this point in the history
  • Loading branch information
glynhudson committed Oct 4, 2012
1 parent 96c7acb commit 9536175
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -283,7 +283,7 @@ static void my_callback (byte status, word off, word len) {
Serial.print("Time: "); Serial.print("Time: ");
Serial.println(line_buf); Serial.println(line_buf);


char tmp[] = {line_buf[1],line_buf[2]}; char tmp[] = {line_buf[1],line_buf[2],0};
byte hour = atoi(tmp); byte hour = atoi(tmp);
tmp[0] = line_buf[4]; tmp[1] = line_buf[5]; tmp[0] = line_buf[4]; tmp[1] = line_buf[5];
byte minute = atoi(tmp); byte minute = atoi(tmp);
Expand Down
2 changes: 1 addition & 1 deletion NanodeRF_multinode/NanodeRF_multinode.ino
Expand Up @@ -245,7 +245,7 @@ static void my_callback (byte status, word off, word len) {
Serial.print("Time: "); Serial.print("Time: ");
Serial.println(line_buf); Serial.println(line_buf);


char tmp[] = {line_buf[1],line_buf[2]}; char tmp[] = {line_buf[1],line_buf[2],0};
byte hour = atoi(tmp); byte hour = atoi(tmp);
tmp[0] = line_buf[4]; tmp[1] = line_buf[5]; tmp[0] = line_buf[4]; tmp[1] = line_buf[5];
byte minute = atoi(tmp); byte minute = atoi(tmp);
Expand Down

0 comments on commit 9536175

Please sign in to comment.