numam-spdk/lib/util
Shuhei Matsumoto b78e763c1a string: spdk_strtol to delegate additional error checking
Error check of strtol is left to users of it. But some use cases
of strtol in SPDK do not have enough error check yet.

For example, strtol returns 0 if there were no digits at all.

It should be avoided for each use case to add enough error checking
for strtol.

Hence spdk_strtol and spdk_strtoll do additional error checking
according to the description of manual of strtol.

Besides, there is no use case of negative number now, and to keep
simplicity, spdk_trtol and spdk_strtoll allows only strings that
is positive number or zero.

As a result of this policy, callers of them only have to check if
the return value is not negative.

Subsequent patches will replace atoi to spdk_strtol because atoi
does not have error check.

Change-Id: If3d549970595e53b1141674e47710fe4dd062bc5
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/441626
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2019-01-29 00:10:57 +00:00
..
base64.c util/base64: add base64 lib and unit tests 2018-07-19 00:50:54 +00:00
bit_array.c util: added bit array bitmask load, store and clear 2018-12-14 15:34:53 +00:00
cpuset.c util/cpuset: fix internal string buffer size 2019-01-12 11:19:12 +00:00
crc16.c util/crc16: Add spdk_crc16_t10dif_copy to use in read strip and write insert 2018-12-20 17:52:29 +00:00
crc32_ieee.c util: add CRC32 utility functions 2017-08-02 19:47:35 -04:00
crc32.c Clean up some incorrect Copyright statements 2018-07-30 16:29:38 +00:00
crc32c.c Update spdk crc32c.c with ARM CRC32 intrinsics 2019-01-16 20:39:18 +00:00
dif.c dif: Fix opposite definition of DIF location parameter from SPDK NVMe API 2019-01-17 17:12:01 +00:00
fd.c util/fd: drop fallback from spdk_fd_get_blocklen() 2017-08-11 19:36:30 -04:00
Makefile dif: Generate DIF for extended LBA payload 2018-12-20 17:52:29 +00:00
strerror_tls.c util: add spdk_strerror() wrapper with TLS support 2018-01-04 15:00:09 -05:00
string.c string: spdk_strtol to delegate additional error checking 2019-01-29 00:10:57 +00:00
uuid.c util/uuid: add a new uuid copy API. 2018-12-06 22:25:09 +00:00