From c9ec4a80073856f758a2f12e1a1e627f9c9fdd85 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 26 Aug 2016 05:17:42 +0200 Subject: [PATCH] Return -1 upon errors --- src/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common.c b/src/common.c index b80553f..5dbdbc8 100644 --- a/src/common.c +++ b/src/common.c @@ -286,7 +286,7 @@ static int _common_symlink(GtkWidget * window, char const * cur) newsymlink = _("New symbolic link"); len = strlen(cur) + strlen(newsymlink) + 2; if((path = malloc(len)) == NULL) - return 1; + return -1; snprintf(path, len, "%s/%s", cur, newsymlink); dialog = gtk_dialog_new_with_buttons(newsymlink, (window != NULL) ? GTK_WINDOW(window) : NULL, @@ -315,7 +315,7 @@ static int _common_symlink(GtkWidget * window, char const * cur) if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) to = gtk_entry_get_text(GTK_ENTRY(widget)); if(to != NULL && strlen(to) > 0 && symlink(to, path) != 0) - ret = 1; + ret = -1; gtk_widget_destroy(dialog); free(path); return ret;