From cadcde52a46ddc310e8e3534fd348ef890df300c Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 15 Jul 2020 12:00:29 +0100 Subject: [PATCH] Remove duplicate code. Coverity Scan 1430458. --- client/pub_shared.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/client/pub_shared.c b/client/pub_shared.c index ae4cb277..bc9901db 100644 --- a/client/pub_shared.c +++ b/client/pub_shared.c @@ -71,7 +71,7 @@ int load_stdin(void) pos += rlen; } if(pos > MQTT_MAX_PAYLOAD){ - err_printf(&cfg, "Error: Message length must be less that %u bytes.\n\n", MQTT_MAX_PAYLOAD); + err_printf(&cfg, "Error: Message length must be less than %u bytes.\n\n", MQTT_MAX_PAYLOAD); free(cfg.message); return 1; } @@ -100,14 +100,9 @@ int load_file(const char *filename) fseek(fptr, 0, SEEK_END); flen = ftell(fptr); if(flen > MQTT_MAX_PAYLOAD){ - err_printf(&cfg, "Error: Message length must be less that %u bytes.\n\n", MQTT_MAX_PAYLOAD); + err_printf(&cfg, "Error: File must be less than %u bytes.\n\n", MQTT_MAX_PAYLOAD); free(cfg.message); return 1; - } - if(flen > 268435455){ - fclose(fptr); - err_printf(&cfg, "Error: File \"%s\" is too large (>268,435,455 bytes).\n", filename); - return 1; }else if(flen == 0){ fclose(fptr); err_printf(&cfg, "Error: File \"%s\" is empty.\n", filename);