X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=keymap.c;h=3944aab770b2537942b9ed8be34cd0099f1d73e6;hp=b76c948799228c3a322456c61e39da4f5d66dc26;hb=a264c7bd834b6a72c90e9f672a2e0fdb06c18083;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/keymap.c b/keymap.c index b76c948..3944aab 100644 --- a/keymap.c +++ b/keymap.c @@ -1,19 +1,10 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1996-2000,2002 Michael R. Elkins - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ #if HAVE_CONFIG_H @@ -27,6 +18,10 @@ #include "mapping.h" #include "mutt_crypt.h" +#include "lib/mem.h" +#include "lib/intl.h" +#include "lib/str.h" + #include #include #include @@ -252,7 +247,7 @@ static int get_op (struct binding_t *bindings, const char *start, size_t len) for (i = 0; bindings[i].name; i++) { if (!ascii_strncasecmp (start, bindings[i].name, len) && - mutt_strlen (bindings[i].name) == len) + safe_strlen (bindings[i].name) == len) return bindings[i].op; } @@ -274,7 +269,7 @@ static char *get_func (struct binding_t *bindings, int op) static void push_string (char *s) { - char *pp, *p = s + mutt_strlen (s) - 1; + char *pp, *p = s + safe_strlen (s) - 1; size_t l; int i, op = OP_NULL; @@ -493,7 +488,7 @@ int km_expand_key (char *s, size_t len, struct keymap_t *map) FOREVER { strfcpy (s, km_keyname (map->keys[p]), len); - len -= (l = mutt_strlen (s)); + len -= (l = safe_strlen (s)); if (++p >= map->len || !len) return (1); @@ -722,7 +717,7 @@ try_bind (char *key, int menu, char *func, struct binding_t *bindings) int i; for (i = 0; bindings[i].name; i++) - if (mutt_strcmp (func, bindings[i].name) == 0) { + if (safe_strcmp (func, bindings[i].name) == 0) { km_bindkey (key, menu, bindings[i].op); return (0); } @@ -885,9 +880,9 @@ int mutt_parse_exec (BUFFER * buf, BUFFER * s, unsigned long data, && CurrentMenu != MENU_PAGER) bindings = OpGeneric; - ops[nops] = get_op (bindings, function, mutt_strlen (function)); + ops[nops] = get_op (bindings, function, safe_strlen (function)); if (ops[nops] == OP_NULL && CurrentMenu != MENU_PAGER) - ops[nops] = get_op (OpGeneric, function, mutt_strlen (function)); + ops[nops] = get_op (OpGeneric, function, safe_strlen (function)); if (ops[nops] == OP_NULL) { mutt_flushinp ();