From f2c019d534d6026d124b312d5a026d129683e233 Mon Sep 17 00:00:00 2001 From: dsl Date: Mon, 7 Jul 2003 12:22:35 +0000 Subject: [PATCH] Change 'Magic number' of menu text files. Correct calculation of window width in msg_prompt_win(). --- usr.bin/msgc/msg_sys.def | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/msgc/msg_sys.def b/usr.bin/msgc/msg_sys.def index 7213e40c9e1e..c4d7604e8432 100644 --- a/usr.bin/msgc/msg_sys.def +++ b/usr.bin/msgc/msg_sys.def @@ -1,4 +1,4 @@ -/* $NetBSD: msg_sys.def,v 1.21 2003/06/27 22:11:59 dsl Exp $ */ +/* $NetBSD: msg_sys.def,v 1.22 2003/07/07 12:22:35 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -111,7 +111,7 @@ msg_file(const char *file) if (msgmap == MAP_FAILED) return -1; /* check_magic */ - if (memcmp(msgmap, "INSTMSGS", 8)) { + if (strcmp(msgmap, "MSGTXTS") != 0) { msg_file(NULL); return -1; } @@ -419,7 +419,7 @@ msg_prompt_win(msg msg_no, int x, int y, int w, int h, w = vsnprintf(NULL, 0, msg_string(msg_no), ap); va_end(ap); if (def != NULL && *def != 0) - w += 2 + strlen(def); + w += 2 + strlen(def) + 1; w += 1 + 2 + max_chars + 1; if (w > maxx) w = maxx;