diff --git a/level.c b/level.c index d1fb371..20df4fe 100644 --- a/level.c +++ b/level.c @@ -13,20 +13,25 @@ void init_level(Game *g, Level *l, char *filepath) { l->data_size = 0; do { l->data[l->data_size++] = atoi(datum); - } while (datum = strtok_r(NULL, ",", &other_guy)); + } while ((datum = strtok_r(NULL, ",", &other_guy))); l->width = l->data_size; - while (first_line = strtok_r(NULL, "\n", &line)) { + while ((first_line = strtok_r(NULL, "\n", &line))) { datum = strtok_r(first_line, ",", &other_guy); do { l->data[l->data_size++] = (char)atoi(datum); - } while (datum = strtok_r(NULL, ",", &other_guy)); + } while ((datum = strtok_r(NULL, ",", &other_guy))); } l->length = l->data_size / l->width; - printf("Loaded level from '%s': %dx%d = %d total bytes\n", filepath, l->length, l->width, l->data_size); + printf( + "Loaded level from '%s': %dx%d = %zd total bytes\n", + filepath, + l->length, + l->width, + l->data_size); UnloadFileText(file_text); - + l->game = g; }