From b5862a263a125aec896543aa636176fd58c15433 Mon Sep 17 00:00:00 2001 From: ELY M <> Date: Mon, 14 Oct 2024 18:31:08 -0500 Subject: [PATCH] spaces in gps will not let it to download weather --- README.md | 2 ++ source/main.c | 14 ++++---------- weather.txt | 8 -------- 3 files changed, 6 insertions(+), 18 deletions(-) delete mode 100644 weather.txt diff --git a/README.md b/README.md index 7569f6a..4f7d94f 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ The video of the app in action on my switch: https://youtu.be/pFggAxKcNsw This weather homebrew app only get you weather info like Temp or Condition. you need to set your GPS in the setting by press - button. +It is important to not leave any spaces. It must be like this +40.1231,-90.3001 Press A or X to get weather info. diff --git a/source/main.c b/source/main.c index fbe4efb..cf6704c 100644 --- a/source/main.c +++ b/source/main.c @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -192,7 +191,7 @@ static bool setMyGPS(void) char *tmpout = NULL; bool err = false; - tmpout = popKeyboard("set your GPS like this 39.232,-93.75", 256); + tmpout = popKeyboard("set your GPS like this 39.232,-93.75 - Make sure you do not leave any spaces", 256); if (tmpout != NULL) { if (*tmpout == 0) { @@ -501,8 +500,8 @@ int main() mygps = readMyGPS(); lat = strtok(mygps, ","); lon = strtok(NULL, ","); - char gpsstring[100]; - snprintf(gpsstring, 100, "My GPS: %s,%s", lat,lon); + char gpsstring[256]; + snprintf(gpsstring, 256, "My GPS: %s,%s", lat,lon); SDL_DrawTextf(renderer, font, SCREEN_WIDTH / 2, 43, CYAN, gpsstring); @@ -543,12 +542,7 @@ int main() } if (kDown & HidNpadButton_Plus) { break; } - - - - - - + SDL_RenderPresent(renderer); diff --git a/weather.txt b/weather.txt deleted file mode 100644 index 53bf160..0000000 --- a/weather.txt +++ /dev/null @@ -1,8 +0,0 @@ - - -400 Bad Request - -

Bad Request

-

Your browser sent a request that this server could not understand.
-

-