style.c (448B)
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #define STYLE_N 8049 + 1000 5 6 void read_style_js(char* string) 7 { 8 FILE* fp = fopen("/opt/rosenrot/style.js", "r"); 9 if (!fp) { // fp is NULL, fopen failed 10 fprintf(stderr, "Failed to open file\n"); 11 string = NULL; 12 return; 13 } 14 int i = 0; 15 int c; 16 while ((c = fgetc(fp)) != EOF) { 17 string[i++] = c; 18 } 19 string[i] = '\0'; 20 fclose(fp); 21 }