* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
- (void) fread(&tmp, sizeof(WINDOW), 1, filep);
- if (ferror(filep)
+ if (fread(&tmp, (size_t) 1, sizeof(WINDOW), filep) < sizeof(WINDOW)
+ || ferror(filep)
- (void) fread(nwin->_line[n].text,
- sizeof(NCURSES_CH_T),
- (size_t) (nwin->_maxx + 1),
- filep);
- if (ferror(filep)) {
+ if (fread(nwin->_line[n].text, (size_t) 1, linesize, filep) < linesize
+ || ferror(filep)) {
- T((T_CALLED("putwin(%p,%p)"), win, filep));
+ T((T_CALLED("putwin(%p,%p)"), (void *) win, (void *) filep));
- if (fwrite(win, sizeof(WINDOW), 1, filep) != 1
+ if (fwrite(win, sizeof(WINDOW), (size_t) 1, filep) != 1
- T((T_CALLED("scr_restore(%p,%s)"), SP_PARM, _nc_visbuf(file)));
+ T((T_CALLED("scr_restore(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
if (_nc_access(file, R_OK) < 0
|| (fp = fopen(file, "rb")) == 0) {
if (_nc_access(file, R_OK) < 0
|| (fp = fopen(file, "rb")) == 0) {
FILE *fp = 0;
T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file)));
if (_nc_access(file, W_OK) < 0
|| (fp = fopen(file, "wb")) == 0) {
FILE *fp = 0;
T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file)));
if (_nc_access(file, W_OK) < 0
|| (fp = fopen(file, "wb")) == 0) {
- T((T_CALLED("scr_init(%p,%s)"), SP_PARM, _nc_visbuf(file)));
+ T((T_CALLED("scr_init(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
- T((T_CALLED("scr_set(%p,%s)"), SP_PARM, _nc_visbuf(file)));
+ T((T_CALLED("scr_set(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));