mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-18 19:41:01 -05:00
Replace all 'sizeof(x)/sizeof(*x)' with lenof.
I noticed a few of these in the course of preparing the previous commit. I must have been writing that idiom out by hand for _ages_ before it became totally habitual to #define it as 'lenof' in every codebase I touch. Now I've gone through and replaced all the old verbosity with nice terse lenofs.
This commit is contained in:
3
sftp.c
3
sftp.c
@ -213,8 +213,7 @@ static int fxp_got_status(struct sftp_packet *pktin)
|
||||
fxp_error_message = "malformed FXP_STATUS packet";
|
||||
fxp_errtype = -1;
|
||||
} else {
|
||||
if (fxp_errtype < 0 ||
|
||||
fxp_errtype >= sizeof(messages) / sizeof(*messages))
|
||||
if (fxp_errtype < 0 || fxp_errtype >= lenof(messages))
|
||||
fxp_error_message = "unknown error code";
|
||||
else
|
||||
fxp_error_message = messages[fxp_errtype];
|
||||
|
Reference in New Issue
Block a user