mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 07:16:23 -05:00
Extra allocation check during initialisation.
This commit is contained in:
parent
5a900d59e6
commit
cfed6fdddf
7
main.c
7
main.c
@ -275,7 +275,12 @@ int main(int argc, char **argv)
|
|||||||
unqname(bname);
|
unqname(bname);
|
||||||
|
|
||||||
/* set this to inactive */
|
/* set this to inactive */
|
||||||
bp = bfind(bname, TRUE, 0);
|
bp = bfind( bname, TRUE, 0) ;
|
||||||
|
if( bp == NULL) {
|
||||||
|
fputs( "Buffer creation failed!\n", stderr) ;
|
||||||
|
exit( EXIT_FAILURE) ;
|
||||||
|
}
|
||||||
|
|
||||||
strncpy( bp->b_fname, argv[ carg], sizeof bp->b_fname - 1) ; /* max filename length limited to NFILEN - 1 (79) */
|
strncpy( bp->b_fname, argv[ carg], sizeof bp->b_fname - 1) ; /* max filename length limited to NFILEN - 1 (79) */
|
||||||
bp->b_fname[ sizeof bp->b_fname - 1] = 0 ;
|
bp->b_fname[ sizeof bp->b_fname - 1] = 0 ;
|
||||||
bp->b_active = FALSE;
|
bp->b_active = FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user