From 911c136c89af436db1339b6b526f388f7a103cf2 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Fri, 16 Apr 2010 05:24:58 +0000 Subject: Fix warning, also added error message for the case of no filename passed. --- source/blender/windowmanager/intern/wm_files.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 7e309b9c876..b6126da33a2 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -491,7 +491,11 @@ int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports) len = strlen(target); - if (len == 0) return; + if (len == 0) { + BKE_report(reports, RPT_ERROR, "Path is empty, cannot save"); + return -1; + } + if (len >= FILE_MAX) { BKE_report(reports, RPT_ERROR, "Path too long, cannot save"); return -1; -- cgit v1.2.3