summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file.c b/src/file.c
index f532efd..b0def28 100644
--- a/src/file.c
+++ b/src/file.c
@@ -2011,10 +2011,10 @@ int plugin_exists(char * name, int len, char * path) {
void * do_autobackup() {
struct sheet * sh = session->cur_doc->cur_sh;
char * curfile = session->cur_doc->name;
- int len = strlen(curfile);
+ int len;
+ if (curfile == NULL || ! (len = strlen(curfile))) return (void *) -1;
//if (session->cur_doc->loading || ! len) return (void *) -1;
//if (! len || ! session->cur_doc->modflg) return (void *) -1;
- if (! len) return (void *) -1;
char * pstr = strrchr(curfile, '/');
int pos = pstr == NULL ? -1 : pstr - curfile;