/* Get image size, if specified */
if (optind < argc) {
int64_t sval;
- sval = strtosz_suffix(argv[optind++], NULL, STRTOSZ_DEFSUFFIX_B);
- if (sval < 0) {
+ char *end;
+ sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);
+ if (sval < 0 || *end) {
error_report("Invalid image size specified! You may use k, M, G or "
"T suffixes for ");
error_report("kilobytes, megabytes, gigabytes and terabytes.");
case 'S':
{
int64_t sval;
- sval = strtosz_suffix(optarg, NULL, STRTOSZ_DEFSUFFIX_B);
- if (sval < 0) {
+ char *end;
+ sval = strtosz_suffix(optarg, &end, STRTOSZ_DEFSUFFIX_B);
+ if (sval < 0 || *end) {
error_report("Invalid minimum zero buffer size for sparse output specified");
return 1;
}