summaryrefslogtreecommitdiff
path: root/sci-libs/stellarsolver/files/stellarsolver-2.5-compiler-warning.patch
blob: eaae908db7746fc786ca2d529e49afbf542953ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 475193d28c0b33b14cecf9492a7c3cd06abcc9f5 Mon Sep 17 00:00:00 2001
From: Tim Surber <me@timsurber.de>
Date: Wed, 10 Apr 2024 23:36:49 +0200
Subject: [PATCH] fix another compiler warning

---
 stellarsolver/astrometry/util/fitstable.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/stellarsolver/astrometry/util/fitstable.c b/stellarsolver/astrometry/util/fitstable.c
index 10e1bc2..5885040 100644
--- a/stellarsolver/astrometry/util/fitstable.c
+++ b/stellarsolver/astrometry/util/fitstable.c
@@ -1227,7 +1227,11 @@ static fitstable_t* open_for_writing(const char* fn, const char* mode, FILE* fid
     else {
         tab->fid = fopen(fn, mode);
         if (!tab->fid) {
-            SYSERROR("Couldn't open output file %s for writing", fn);
+            if (fn != NULL) {
+                SYSERROR("Couldn't open output file %s for writing", fn);
+            } else {
+                SYSERROR("Couldn't open output file because the filename is null");
+            }
             goto bailout;
         }
     }