X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-v3.c;h=7f63b6eb8e216f802a5addb25e3db25b44e8d6fa;hb=9cbff28c8a97e7a5dc36f6e6225a9d5e2eab8f06;hp=02853b1283ebf5005117d5e511a89b30f27da3c3;hpb=8d4e6df897f521b2e0be51933f627261388cbd20;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-v3.c b/src/afb-api-v3.c index 02853b12..7f63b6eb 100644 --- a/src/afb-api-v3.c +++ b/src/afb-api-v3.c @@ -325,19 +325,16 @@ int afb_api_v3_del_verb( const char *verb, void **vcbdata) { - struct afb_verb_v3 **v, **e, *i; + struct afb_verb_v3 *v; + int i; - v = api->verbs; - e = &v[api->count]; - while (v != e) { - i = *v++; - if (!strcasecmp(i->verb, verb)) { - api->count--; + for (i = 0 ; i < api->count ; i++) { + v = api->verbs[i]; + if (!strcasecmp(verb, v->verb)) { + api->verbs[i] = api->verbs[--api->count]; if (vcbdata) - *vcbdata = i->vcbdata; - if (v != e) - *--v = *--e; - free(i); + *vcbdata = v->vcbdata; + free(v); return 0; } }