diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sdtui.c | 2 | ||||
-rw-r--r-- | src/stardict.c | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/sdtui.c b/src/sdtui.c index c9b88e6..8de59b2 100644 --- a/src/sdtui.c +++ b/src/sdtui.c @@ -37,9 +37,7 @@ #include <termo.h> // input #include <ncurses.h> // output #include <termios.h> -#ifndef TIOCGWINSZ #include <sys/ioctl.h> -#endif // ! TIOCGWINSZ #include "config.h" #include "stardict.h" diff --git a/src/stardict.c b/src/stardict.c index 8b55f99..cdd11a1 100644 --- a/src/stardict.c +++ b/src/stardict.c @@ -309,26 +309,24 @@ load_ifo (StardictInfo *sti, const gchar *path, GError **error) goto error; } - ret_val = TRUE; - - // FIXME check for zeros, don't assume that 0 means for "not set" + // FIXME check for zeros, don't assume that 0 means "not set" if (!sti->book_name || !*sti->book_name) { g_set_error (error, STARDICT_ERROR, STARDICT_ERROR_INVALID_DATA, "%s: %s", path, _("no book name specified")); - ret_val = FALSE; + goto error; } if (!sti->word_count) { g_set_error (error, STARDICT_ERROR, STARDICT_ERROR_INVALID_DATA, "%s: %s", path, _("word count not specified")); - ret_val = FALSE; + goto error; } if (!sti->idx_filesize) { g_set_error (error, STARDICT_ERROR, STARDICT_ERROR_INVALID_DATA, "%s: %s", path, _("index file size not specified")); - ret_val = FALSE; + goto error; } if (!sti->idx_offset_bits) @@ -338,9 +336,11 @@ load_ifo (StardictInfo *sti, const gchar *path, GError **error) g_set_error (error, STARDICT_ERROR, STARDICT_ERROR_INVALID_DATA, "%s: %s: %lu", path, _("invalid index offset bits"), sti->idx_offset_bits); - ret_val = FALSE; + goto error; } + ret_val = TRUE; + error: if (!ret_val) { |