Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
liyansong2018 committed Jun 7, 2022
1 parent 27adbe8 commit 744799c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/weather-configurator.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ int main(int argc, char * argv[]) {
}

FILE * f = fopen("/etc/weather.json", "w");
if (f == NULL) {
fprintf(stderr, "Configuration is not set. Please check /etc/weather.json or your permissions.\n");
fprintf(stderr, "(Press ENTER to exit.)\n");
getchar();
return 0;
}
fprintf(f, "{\n");
fprintf(f, " \"city\": \"%s\",\n", city);
fprintf(f, " \"units\": \"%s\",\n", units);
Expand Down

0 comments on commit 744799c

Please sign in to comment.