summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/calendar/calcpp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/calendar/calcpp.c b/usr.bin/calendar/calcpp.c
index 6e3b339..413739b 100644
--- a/usr.bin/calendar/calcpp.c
+++ b/usr.bin/calendar/calcpp.c
@@ -155,8 +155,11 @@ tokenscpp(char *buf, char *string)
s = p+1;
if ((p = strchr(s, '>')) != NULL)
*p = '\0';
- snprintf (string, MAXPATHLEN, "%s/%s",
- _PATH_INCLUDE, s);
+ if (*s != '/')
+ snprintf (string, MAXPATHLEN, "%s/%s",
+ _PATH_INCLUDE, s);
+ else
+ strncpy(string, s, MAXPATHLEN);
} else if (*p == '(') {
s = p+1;
if ((p = strchr(p, '>')) != NULL)
OpenPOWER on IntegriCloud