Use NULL instead of strlen for printing strings

This makes more sense and also removes the dependency for `string.h`.
This commit is contained in:
finga 2021-09-19 22:14:00 +02:00
parent 47bd5e45f7
commit c48e4a31ab

View file

@ -4,7 +4,6 @@
#include <util/delay.h>
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#define SPI_PORT PORTB
#define SPI_DDR DDRB
@ -255,7 +254,7 @@ static void lcd_write_character_page(const char character,
static void lcd_write_string_page(const char* string,
const uint8_t page,
const bool invert) {
for (uint8_t i = 0; i < strlen(string); i++) {
for (uint8_t i = 0; string[i] != 0; i++) {
lcd_write_kerning(2, invert);
lcd_write_character_page(string[i], page, invert);
}