FreeCalypso > hg > fc-sim-tools
view libutil/decimal_incr.c @ 96:a5cfe5135701
simtool: grcard2.c split into grcard2ki.c and grcard2pins.c
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Wed, 05 May 2021 03:55:23 +0000 |
| parents | 9c9f6adbaedb |
| children |
line wrap: on
line source
/* * This module implements a function for incrementing decimal strings, * to be used in producing ranges of ICCID and IMSI numbers. */ #include <sys/types.h> void decimal_string_increment(str, ndigits) u_char *str; unsigned ndigits; { u_char *p; for (p = str + ndigits; p > str; ) { --p; (*p)++; if (*p < 10) return; *p = 0; } }
