Skip to content

Commit 3c96191

Browse files
committed
ability to skip cmd of write batch
1 parent 2f9d859 commit 3c96191

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nrf24batch.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ void display_remove_asterisk(char *fsp, uint8_t vx)
885885
if(p2) { // remove '*' or '*n'
886886
int pos = p2 - fsp;
887887
if((pos -= vx) < 0) pos = 0;
888-
memmove(screen_buf + pos, screen_buf + pos + (*(p2 + 1) == ':' ? 1 : 2), FONT_5x7_SCREEN_WIDTH + 1);
888+
memmove(screen_buf + pos, screen_buf + pos + (*(p2 + 1) == ':' ? 1 : 2), FONT_5x7_SCREEN_WIDTH + 1 + 2);
889889
}
890890
}
891891

@@ -1002,8 +1002,8 @@ static void render_callback(Canvas* const canvas, void* ctx) {
10021002
canvas_draw_line(canvas, n, y, n, y - 1);
10031003
}
10041004
}
1005-
strncpy(screen_buf, p + vx, FONT_5x7_SCREEN_WIDTH);
1006-
screen_buf[FONT_5x7_SCREEN_WIDTH] = '\0';
1005+
strncpy(screen_buf, p + vx, FONT_5x7_SCREEN_WIDTH + 2);
1006+
screen_buf[FONT_5x7_SCREEN_WIDTH + 2] = '\0';
10071007
display_remove_asterisk(p, vx);
10081008
canvas_draw_str(canvas, 6, y, screen_buf);
10091009
}

0 commit comments

Comments
 (0)