X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fopt%2Fopt.c;h=d376a598da932445de592c8f12e2466d4bc431bd;hp=d4601dfbb230a3076edfa64d8b5232996f4d59d2;hb=4f20b75c6133425f2b8c369bb1ecfbd7d3410353;hpb=e5fb923ba3735c758ef795eb69d5ee1c6f0a94e9 diff --git a/ccan/opt/opt.c b/ccan/opt/opt.c index d4601dfb..d376a598 100644 --- a/ccan/opt/opt.c +++ b/ccan/opt/opt.c @@ -189,7 +189,8 @@ bool opt_unregister(const char *names) if (found == -1) return false; opt_count--; - memmove(&opt_table[found], &opt_table[found+1], opt_count - found); + memmove(&opt_table[found], &opt_table[found+1], + (opt_count - found) * sizeof(opt_table[found])); return true; }