config = (struct config_file*)malloc(sizeof(struct config_file) + FCRAM_SPACING / 2);
memset(config, 0, sizeof(struct config_file) + FCRAM_SPACING / 2);
enable_list = (uint8_t*)config + sizeof(struct config_file);
+ fclose(f);
}
// Zero on success.
abort("Invalid font file: w/h is 0 - not loaded\n");
}
- unsigned int c_font_w = (new_w / 8) + (new_w % 8 ? 1 : 0);
+ unsigned int c_font_w = (new_w / 8) + ((new_w % 8) ? 1 : 0);
font_data = malloc(c_font_w * new_h * (256 - ' '));
if (x >= width || y >= height)
return; // OOB
- unsigned int c_font_w = (font_w / 8) + (font_w % 8 ? 1 : 0);
+ unsigned int c_font_w = (font_w / 8) + ((font_w % 8) ? 1 : 0);
for (unsigned int yy = 0; yy < font_h; yy++) {
unsigned int xDisplacement = (x * SCREEN_DEPTH * height);
fp->mode = (mode[0] == 'r' ? FA_READ : (FA_WRITE | FA_OPEN_ALWAYS));
- if (f_open(&(fp->handle), filename, fp->mode))
+ if (f_open(&(fp->handle), filename, fp->mode)) {
+ free(fp);
return NULL;
+ }
fp->is_open = 1;