1
0
mirror of https://github.com/rfivet/uemacs.git synced 2025-09-27 07:24:08 -04:00

Replace strncpy by mystrscpy.

This commit is contained in:
2019-06-19 19:49:20 +08:00
parent 033012f645
commit f0836bb66a
12 changed files with 81 additions and 66 deletions

View File

@@ -21,6 +21,7 @@
#include "file.h"
#include "input.h"
#include "mlout.h"
#include "util.h"
#include "window.h"
@@ -247,8 +248,7 @@ ask:
}
/* copy buffer name to structure */
strncpy( curbp->b_bname, bufn, sizeof( bname_t) - 1) ;
curbp->b_bname[ sizeof( bname_t) - 1] = '\0' ;
mystrscpy( curbp->b_bname, bufn, sizeof( bname_t)) ;
free( bufn) ;
curwp->w_flag |= WFMODE ; /* make mode line replot */
@@ -525,8 +525,7 @@ struct buffer *bfind( const char *bname, int cflag, int bflag)
bp->b_nwnd = 0;
bp->b_linep = lp;
bp->b_fname[ 0] = '\0' ;
strncpy( bp->b_bname, bname, sizeof( bname_t) - 1) ;
bp->b_bname[ sizeof( bname_t) - 1] = '\0' ;
mystrscpy( bp->b_bname, bname, sizeof( bname_t)) ;
lp->l_fp = lp;
lp->l_bp = lp;
}