freebsd-ports/math/calc/files/patch-lib_calc.c
Jean-Marc Zucconi d9d34442c2 Upgrade to version 2.11.5t4.5
PR:		ports/44132
Submitted by:	Sergey A.Osokin <osa@FreeBSD.org.ru>
2002-11-04 21:09:01 +00:00

18 lines
461 B
C

--- lib_calc.c.orig Mon Feb 7 22:08:08 2000
+++ lib_calc.c Mon Feb 7 22:10:42 2000
@@ -407,9 +407,13 @@
if (ent == NULL) {
/* just assume . is home if all else fails */
home = ".";
+ } else {
+ home = (char *)malloc(strlen(ent->pw_dir)+1);
+ if (home == NULL)
+ home = ".";
+ else
+ strcpy(home, ent->pw_dir);
}
- home = (char *)malloc(strlen(ent->pw_dir)+1);
- strcpy(home, ent->pw_dir);
}
/* determine the $PAGER value */