lq-text: LQU_cknatstr

API int LQU_cknatstr (str) CONST char *str;

Purpose

Checks whether the given string argument represents a natural number; that is, an optional plus or minus sign followed by one or more decimal digits. Leading whitespace, as reported by the isspace macro, is ignored, but no trailing whitespace is allowed.

Returns

Zero if the match fails, and one if it succeeds.

Bugs