diff options
author | johnnypops <johnnypops> | 2011-04-18 20:14:20 (GMT) |
---|---|---|
committer | johnnypops <johnnypops> | 2011-04-18 20:14:20 (GMT) |
commit | b61668da29ed6a566834a529b663ebc930ccca52 (patch) | |
tree | 9cfac9ef02e16efbfe007d95bfadbbdbab799aaf | |
parent | 1698787cbf1649a1596353a1baa0d95dbb8aabd1 (diff) |
Fixed error reporting when make_directory() fails.
-rw-r--r-- | src/tuxpaint.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tuxpaint.c b/src/tuxpaint.c index db88263..038c8f3 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -11531,6 +11531,7 @@ static void save_current(void) if (!make_directory("", "Can't create user data directory")) { draw_tux_text(TUX_OOPS, strerror(errno), 0); + return; } fname = get_fname("current_id.txt", DIR_SAVE); @@ -12720,7 +12721,7 @@ static int do_save(int tool, int dont_show_success_results) if (!make_directory("", "Can't create user data directory")) { fprintf(stderr, "Cannot save the any pictures! SORRY!\n\n"); - draw_tux_text(TUX_OOPS, SDL_GetError(), 0); + draw_tux_text(TUX_OOPS, strerror(errno), 0); return 0; } @@ -12732,7 +12733,7 @@ static int do_save(int tool, int dont_show_success_results) if (!make_directory("saved", "Can't create user data directory")) { fprintf(stderr, "Cannot save any pictures! SORRY!\n\n"); - draw_tux_text(TUX_OOPS, SDL_GetError(), 0); + draw_tux_text(TUX_OOPS, strerror(errno), 0); return 0; } @@ -12744,7 +12745,7 @@ static int do_save(int tool, int dont_show_success_results) if (!make_directory("saved/.thumbs", "Can't create user data thumbnail directory")) { fprintf(stderr, "Cannot save any pictures! SORRY!\n\n"); - draw_tux_text(TUX_OOPS, SDL_GetError(), 0); + draw_tux_text(TUX_OOPS, strerror(errno), 0); return 0; } @@ -12755,7 +12756,7 @@ static int do_save(int tool, int dont_show_success_results) if (!make_directory("saved/.label", "Can't create label information directory")) { fprintf(stderr, "Cannot save label information! SORRY!\n\n"); - draw_tux_text(TUX_OOPS, SDL_GetError(), 0); + draw_tux_text(TUX_OOPS, strerror(errno), 0); return 0; } |