diff options
author | Muhammad Moinur Rahman <bofh@FreeBSD.org> | 2022-12-31 19:49:42 +0000 |
---|---|---|
committer | Muhammad Moinur Rahman <bofh@FreeBSD.org> | 2022-12-31 21:58:55 +0000 |
commit | 39191036a1f8c22f0d1424afa90f2f2559f124ad (patch) | |
tree | c7620c8c34ebfc0a24eadd27090632c119dd5b50 | |
parent | 996fc7183efb06dd603a32cdea547bf5b0c5eca0 (diff) | |
download | ports-39191036a1f8c22f0d1424afa90f2f2559f124ad.tar.gz ports-39191036a1f8c22f0d1424afa90f2f2559f124ad.zip |
astro/accrete: Fix RUNTIME
Segmentation Fault occurs if program is executed in a directory without
write privileges.
Patch provided exits gracefully if *fp is NULL before fprintf's attempt
to write to non-existent file.
- Add LICENSE BSD3CLAUSE
PR: 268661
Reported by: eylusion@gmail.com
-rw-r--r-- | astro/accrete/Makefile | 3 | ||||
-rw-r--r-- | astro/accrete/files/patch-display.c | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/astro/accrete/Makefile b/astro/accrete/Makefile index daa279fd5a34..ef45ff7024cc 100644 --- a/astro/accrete/Makefile +++ b/astro/accrete/Makefile @@ -1,5 +1,6 @@ PORTNAME= accrete PORTVERSION= 1.0 +PORTREVISION= 1 CATEGORIES= astro MASTER_SITES= SF @@ -7,6 +8,8 @@ MAINTAINER= ports@FreeBSD.org COMMENT= Physical simulation of solar system planet formation WWW= https://sourceforge.net/projects/accrete/ +LICENSE= BSD3CLAUSE + MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}" PREFIX=${STAGEDIR}${PREFIX} \ CDEBUG="" COPT="" PLIST_FILES= bin/accrete diff --git a/astro/accrete/files/patch-display.c b/astro/accrete/files/patch-display.c new file mode 100644 index 000000000000..73a2e4174462 --- /dev/null +++ b/astro/accrete/files/patch-display.c @@ -0,0 +1,14 @@ +--- display.c.orig 2022-12-31 01:22:36 UTC ++++ display.c +@@ -8,6 +8,11 @@ display_system (void) + + FILE *f; + f = fopen("New.System", "w"); ++ if (f == NULL) ++ { ++ perror("New.System"); ++ exit(1); ++ } + + fprintf(f," SYSTEM CHARACTERISTICS\n"); + fprintf(f,"Mass of central star: %6.3f solar masses\n", stellar_mass_ratio); |