projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Renamed ZOOM_process_event to ZOOM_event_nonblock to signal that it
[yaz-moved-to-github.git]
/
src
/
oid.c
diff --git
a/src/oid.c
b/src/oid.c
index
b5cafbe
..
8fef519
100644
(file)
--- a/
src/oid.c
+++ b/
src/oid.c
@@
-1,8
+1,8
@@
/*
/*
- * Copyright (C) 1995-2005, Index Data ApS
+ * Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* See the file LICENSE for details.
*
- * $Id: oid.c,v 1.11 2005-06-25 15:46:04 adam Exp $
+ * $Id: oid.c,v 1.13 2007-01-03 08:42:15 adam Exp $
*/
/**
*/
/**
@@
-504,7
+504,7
@@
struct oident *oid_addent (int *oid, enum oid_proto proto,
if (!desc)
{
if (!desc)
{
- char desc_str[OID_SIZE*10];
+ char desc_str[OID_STR_MAX];
int i;
*desc_str = '\0';
int i;
*desc_str = '\0';
@@
-599,7
+599,8
@@
void oid_trav (void (*func)(struct oident *oidinfo, void *vp), void *vp)
(*func)(&ol->oident, vp);
}
(*func)(&ol->oident, vp);
}
-int *oid_name_to_oid(oid_class oclass, const char *name, int *oid) {
+int *oid_name_to_oid(oid_class oclass, const char *name, int *oid)
+{
struct oident ent;
/* Translate syntax to oid_val */
struct oident ent;
/* Translate syntax to oid_val */
@@
-614,21
+615,24
@@
int *oid_name_to_oid(oid_class oclass, const char *name, int *oid) {
return oid_ent_to_oid(&ent, oid);
}
return oid_ent_to_oid(&ent, oid);
}
-char *oid_to_dotstring(const int *oid, char *oidbuf) {
+char *oid_to_dotstring(const int *oid, char *oidbuf)
+{
char tmpbuf[20];
int i;
oidbuf[0] = '\0';
char tmpbuf[20];
int i;
oidbuf[0] = '\0';
- for (i = 0; oid[i] != -1; i++) {
+ for (i = 0; oid[i] != -1 && i < OID_SIZE; i++)
+ {
sprintf(tmpbuf, "%d", oid[i]);
sprintf(tmpbuf, "%d", oid[i]);
- if (i > 0) strcat(oidbuf, ".");
+ if (i > 0)
+ strcat(oidbuf, ".");
strcat(oidbuf, tmpbuf);
}
strcat(oidbuf, tmpbuf);
}
-
return oidbuf;
}
return oidbuf;
}
-char *oid_name_to_dotstring(oid_class oclass, const char *name, char *oidbuf) {
+char *oid_name_to_dotstring(oid_class oclass, const char *name, char *oidbuf)
+{
int oid[OID_SIZE];
(void) oid_name_to_oid(oclass, name, oid);
int oid[OID_SIZE];
(void) oid_name_to_oid(oclass, name, oid);