mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-22 17:16:34 -05:00
Extra allocation check during initialisation.
This commit is contained in:
parent
5a900d59e6
commit
cfed6fdddf
5
main.c
5
main.c
@ -276,6 +276,11 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* 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