00001 /* This file is part of the YAZ toolkit. 00002 * Copyright (C) 1995-2008 Index Data 00003 * See the file LICENSE for details. 00004 */ 00005 00011 #if HAVE_CONFIG_H 00012 #include <config.h> 00013 #endif 00014 00015 #include <string.h> 00016 #include <ctype.h> 00017 #include <yaz/marcdisp.h> 00018 00022 int atoi_n (const char *buf, int len) 00023 { 00024 int val = 0; 00025 00026 while (--len >= 0) 00027 { 00028 if (isdigit (*(const unsigned char *) buf)) 00029 val = val*10 + (*buf - '0'); 00030 buf++; 00031 } 00032 return val; 00033 } 00034 00035 /* 00036 * Local variables: 00037 * c-basic-offset: 4 00038 * indent-tabs-mode: nil 00039 * End: 00040 * vim: shiftwidth=4 tabstop=8 expandtab 00041 */ 00042
1.5.6