openbsd-ports/x11/pwm/patches/patch-readconfig_c
naddy 73912c9d4a Update to release 20030528.
From new maintainer Gregory Steuck <greg-openbsd-pwm@nest.cx>.
2003-06-05 23:01:51 +00:00

16 lines
594 B
Plaintext

$OpenBSD: patch-readconfig_c,v 1.1 2003/06/05 23:01:51 naddy Exp $
--- readconfig.c.orig Sun Jun 1 14:01:37 2003
+++ readconfig.c Sun Jun 1 15:15:23 2003
@@ -1025,8 +1025,9 @@ bool read_config(const char* cfgfile)
if(cfgfile==NULL){
cfgfile=getenv("HOME");
if(cfgfile!=NULL){
- tmp=ALLOC_N(char, strlen(cfgfile)+strlen(CF_USER_CFGFILE)+2);
- sprintf(tmp, "%s/%s", cfgfile, CF_USER_CFGFILE);
+ int tmp_len = strlen(cfgfile)+strlen(CF_USER_CFGFILE)+2;
+ tmp=ALLOC_N(char, tmp_len);
+ snprintf(tmp, tmp_len, "%s/%s", cfgfile, CF_USER_CFGFILE);
cfgfile=tmp;
}