long long unsigned parse_arg_size(char *str) {
	long long unsigned result = 0;
	int len = strlen(str);
	sscanf(str, "%llu", &result);

	char suffix = *(str + len - 1);
	if (!isdigit(suffix) && (suffix == 'k' || suffix == 'm' || suffix == 'g')) {
		len -= 1;
	}

	/* checks for is value valid positive number */
	for (int i = 0; i < len; i++) {
		if (!isdigit(*(str+i))) {
			return 0;
		}
	}

	if (isdigit(suffix))
		return result;

	switch (suffix) {
	case 'k':
		result *= 1024;
		break;
	case 'm':
		result *= 1024 * 1024;
		break;
	case 'g':
		result *= 1024 * 1024 * 1024;
		break;
	default:
		result = 0;
		break;
	}

	return result;
}
long long unsigned parse_arg_size(char *str) {
	long long unsigned result = 0;
	int len = strlen(str);
	sscanf(str, "%llu", &result);

	char suffix = *(str + len - 1);
	if (!isdigit(suffix) && (suffix == 'k' || suffix == 'm' || suffix == 'g')) {
		len -= 1;
	}

	 
	for (int i = 0; i < len; i++) {
		if (!isdigit(*(str+i))) {
			return 0;
		}
	}

	if (isdigit(suffix))
		return result;

	switch (suffix) {
	case 'k':
		result *= 1024;
		break;
	case 'm':
		result *= 1024 * 1024;
		break;
	case 'g':
		result *= 1024 * 1024 * 1024;
		break;
	default:
		result = 0;
		break;
	}

	return result;
}