Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
afb-session: Verbs for timeout and remining time
[src/app-framework-binder.git]
/
src
/
afb-export.c
diff --git
a/src/afb-export.c
b/src/afb-export.c
index
304395a
..
840bd91
100644
(file)
--- a/
src/afb-export.c
+++ b/
src/afb-export.c
@@
-153,8
+153,6
@@
static void old_vverbose_cb(void *closure, int level, const char *file, int line
static struct afb_eventid *eventid_make_cb(void *closure, const char *name)
{
static struct afb_eventid *eventid_make_cb(void *closure, const char *name)
{
- size_t plen, nlen;
- char *event;
struct afb_export *export = closure;
/* check daemon state */
struct afb_export *export = closure;
/* check daemon state */
@@
-164,16
+162,8
@@
static struct afb_eventid *eventid_make_cb(void *closure, const char *name)
return NULL;
}
return NULL;
}
- /* makes the event name */
- plen = strlen(export->apiname);
- nlen = strlen(name);
- event = alloca(nlen + plen + 2);
- memcpy(event, export->apiname, plen);
- event[plen] = '/';
- memcpy(event + plen + 1, name, nlen + 1);
-
/* create the event */
/* create the event */
- return afb_evt_eventid_create
(event
);
+ return afb_evt_eventid_create
2(export->apiname, name
);
}
static struct afb_event event_make_cb(void *closure, const char *name)
}
static struct afb_event event_make_cb(void *closure, const char *name)
@@
-241,7
+231,7
@@
static int rename_api_cb(void *closure, const char *name)
errno = EINVAL;
return -1;
}
errno = EINVAL;
return -1;
}
- if (!afb_api_is_valid_name(name)) {
+ if (!afb_api_is_valid_name(name
, 1
)) {
ERROR("[API %s] Can't rename to %s: bad API name", export->apiname, name);
errno = EINVAL;
return -1;
ERROR("[API %s] Can't rename to %s: bad API name", export->apiname, name);
errno = EINVAL;
return -1;