projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6db7603
)
Warn if non-integer is passed to 'att' directive'
author
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 23 Aug 2006 13:56:07 +0000
(13:56 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 23 Aug 2006 13:56:07 +0000
(13:56 +0000)
data1/d1_attset.c
patch
|
blob
|
history
diff --git
a/data1/d1_attset.c
b/data1/d1_attset.c
index
f7c82c3
..
fe948b0
100644
(file)
--- a/
data1/d1_attset.c
+++ b/
data1/d1_attset.c
@@
-1,4
+1,4
@@
-/* $Id: d1_attset.c,v 1.11 2006-08-14 10:40:06 adam Exp $
+/* $Id: d1_attset.c,v 1.12 2006-08-23 13:56:07 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
Copyright (C) 1995-2006
Index Data ApS
@@
-84,6
+84,7
@@
data1_attset *data1_read_attset(data1_handle dh, const char *file)
{
int num;
char *name;
{
int num;
char *name;
+ char *endptr;
data1_att *t;
if (argc < 3)
data1_att *t;
if (argc < 3)
@@
-96,7
+97,13
@@
data1_attset *data1_read_attset(data1_handle dh, const char *file)
yaz_log(YLOG_WARN, "%s:%d: Local attributes not supported",
file, lineno);
}
yaz_log(YLOG_WARN, "%s:%d: Local attributes not supported",
file, lineno);
}
- num = atoi (argv[1]);
+ num = strtol(argv[1], &endptr, 10);
+ if (*endptr != '\0')
+ {
+ yaz_log(YLOG_WARN, "%s:%d: Bad attribute integer %s",
+ file, lineno, argv[1]);
+ continue;
+ }
name = argv[2];
t = *attp = (data1_att *)nmem_malloc(mem, sizeof(*t));
name = argv[2];
t = *attp = (data1_att *)nmem_malloc(mem, sizeof(*t));