Skip to content
Snippets Groups Projects
Commit 0ad946a7 authored by Jan Hák's avatar Jan Hák
Browse files

knsupdate: autocomplete - fix wrong pointer iteration

parent e19e3b7d
No related merge requests found
Pipeline #94551 passed with stages
in 5 minutes and 39 seconds
This commit is part of merge request !1428. Comments created here will be created in the context of that merge request.
......@@ -67,7 +67,7 @@ int cmd_zone(const char* lp, knsupdate_params_t *params);
* This way we could identify command byte-per-byte and
* cancel early if the next is lexicographically greater.
*/
const char* knsupdate_cmd_array[] = {
const char* const knsupdate_cmd_array[] = {
"\x3" "add",
"\x6" "answer",
"\x5" "class", /* {classname} */
......
......@@ -18,7 +18,7 @@
#include "utils/knsupdate/knsupdate_params.h"
extern const char* knsupdate_cmd_array[];
extern const char* const knsupdate_cmd_array[];
int knsupdate_exec(knsupdate_params_t *params);
......
......@@ -90,7 +90,7 @@ static unsigned char complete(EditLine *el, int ch)
// Find the command descriptor.
const char **desc = knsupdate_cmd_array;
while (*desc != NULL && strcmp((*desc) + 1, argv[0]) != 0) {
(*desc)++;
desc++;
}
if (*desc == NULL) {
goto complete_exit;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment