summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/autotrace/atou.c
blob: 4d296547cb23552b31920b8f40db2025fb6b7658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* atou.c: like atoi, but if the number is negative, abort. */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* Def: HAVE_CONFIG_H */

#include "logreport.h"
#include "atou.h"

unsigned atou(gchar * s)
{
  int i = atoi(s);

  if (i < 0)
    FATAL("I expected a positive number, not %d", i);

  return (unsigned)i;
}