X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fatoin.c;h=fc40f1957532bcb13892a823f732a0a9b2706352;hp=cb3a89922eb9efe987db5c11eb7ada47ea1dd9a8;hb=2979c8fc3b5c53c06facad850dcae09645b43044;hpb=c9408db23d24baece38e05035864f933ea5ea071 diff --git a/src/atoin.c b/src/atoin.c index cb3a899..fc40f19 100644 --- a/src/atoin.c +++ b/src/atoin.c @@ -1,8 +1,13 @@ /* - * Copyright (c) 1997-2004, Index Data + * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: atoin.c,v 1.2 2004-08-13 11:35:37 adam Exp $ + * $Id: atoin.c,v 1.8 2007-01-03 08:42:15 adam Exp $ + */ + +/** + * \file atoin.c + * \brief Implements atoi_n function. */ #if HAVE_CONFIG_H @@ -11,8 +16,11 @@ #include #include -#include +#include +/** + * atoi_n: like atoi but reads at most len characters. + */ int atoi_n (const char *buf, int len) { int val = 0; @@ -21,8 +29,16 @@ int atoi_n (const char *buf, int len) { if (isdigit (*(const unsigned char *) buf)) val = val*10 + (*buf - '0'); - buf++; + buf++; } return val; } +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +