about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 38468969e..f81ee8d5d 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -752,14 +752,11 @@ checkmailpath(char **s)
 		    fprintf(shout, "You have new mail.\n");
 		    fflush(shout);
 		} else {
-		    VARARR(char, usav, underscorelen);
-		    int sl = strlen(*s);
+		    VARARR(char, usav, underscoreused);
 
-		    if (sl >= underscorelen) {
-			zfree(underscore, underscorelen);
-			underscore = (char *) zalloc(underscorelen = sl + 32);
-		    }
-		    strcpy(underscore, *s);
+		    memcpy(usav, underscore, underscoreused);
+
+		    setunderscore(*s);
 		    HEAPALLOC {
 			u = dupstring(u);
 			if (! parsestr(u)) {
@@ -769,7 +766,7 @@ checkmailpath(char **s)
 			    fflush(shout);
 			}
 		    } LASTALLOC;
-		    strcpy(underscore, usav);
+		    setunderscore(usav);
 		}
 	    }
 	    if (isset(MAILWARNING) && st.st_atime > st.st_mtime &&