1dd8aba
diff --git a/src/cstdio.c b/src/cstdio.c
1dd8aba
index 7b6fe6d..0a0bd5b 100644
7415631
--- a/src/cstdio.c
7415631
+++ b/src/cstdio.c
1dd8aba
@@ -144,7 +144,7 @@ int getbl(p,end)char*p,*end;					  /* my gets */
7415631
       { case '\n':case EOF:*q='\0';
7415631
 	   return overflow?-1:p!=q;	     /* did we read anything at all? */
7415631
       }
7415631
-     if(q==end)	    /* check here so that a trailing backslash won't be lost */
7415631
+     if(q>=end)	    /* check here so that a trailing backslash won't be lost */
7415631
 	q=p,overflow=1;
7415631
      *q++=i;
7415631
    }
1dd8aba
@@ -199,7 +199,7 @@ int getlline(target,end)char*target,*end;
7415631
 	   if(*(target=strchr(target,'\0')-1)=='\\')
7415631
 	    { if(chp2!=target)				  /* non-empty line? */
7415631
 		 target++;		      /* then preserve the backslash */
7415631
-	      if(target>end-2)			  /* space enough for getbl? */
7415631
+	      if(target>=end-2)			  /* space enough for getbl? */
7415631
 		 target=end-linebuf,overflow=1;		/* toss what we have */
7415631
 	      continue;
7415631
 	    }
1dd8aba
diff --git a/src/formail.c b/src/formail.c
1dd8aba
index 1f5c9dd..49b9967 100644
7415631
--- a/src/formail.c
7415631
+++ b/src/formail.c
1dd8aba
@@ -219,7 +219,8 @@ static char*getsender(namep,fldp,headreply)char*namep;struct field*fldp;
7415631
   if(i>=0&&(i!=maxindex(sest)||fldp==rdheader))		  /* found anything? */
7415631
    { char*saddr;char*tmp;			     /* determine the weight */
7415631
      nowm=areply&&headreply?headreply==1?sest[i].wrepl:sest[i].wrrepl:i;chp+=j;
7415631
-     tmp=malloc(j=fldp->Tot_len-j);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
7415631
+     tmp=malloc((j=fldp->Tot_len-j) + 1);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
1dd8aba
+     chp[j]='\0';
7415631
      if(sest[i].head==From_)
7415631
       { char*pastad;
7415631
 	if(strchr(saddr=chp,'\n'))		     /* multiple From_ lines */
1dd8aba
@@ -364,7 +365,7 @@ static PROGID;
1dd8aba
 
1dd8aba
 int main(lastm,argv)int lastm;const char*const argv[];
1dd8aba
 { int i,split=0,force=0,bogus=1,every=0,headreply=0,digest=0,nowait=0,keepb=0,
1dd8aba
-   minfields=(char*)progid-(char*)progid,conctenate=0,babyl=0,babylstart,
1dd8aba
+   minfields=(char*)progid-(char*)progid,conctenate=0,babyl=0,babylstart=0,
1dd8aba
    berkeley=0,forgetclen;
1dd8aba
   long maxlen,ctlength;FILE*idcache=0;pid_t thepid;
1dd8aba
   size_t j,lnl,escaplen;char*chp,*namep,*escap=ESCAP;
1dd8aba
diff --git a/src/formisc.c b/src/formisc.c
1dd8aba
index c48df52..5c2869d 100644
7415631
--- a/src/formisc.c
7415631
+++ b/src/formisc.c
1dd8aba
@@ -66,7 +66,7 @@ inc:	   start++;
7415631
 retz:	      *target='\0';
7415631
 ret:	      return start;
7415631
 	    }
7415631
-	   if(*start=='\\')
7415631
+	   if(*start=='\\' && *(start + 1))
7415631
 	      *target++='\\',start++;
7415631
 	   hitspc=2;
7415631
 	   goto normal;					      /* normal word */