- if (newstr == (char *) NULL)
- return ((char *) NULL);
- else
- return (strcpy(newstr, str));
+int
+menu_err_hook(who, code, fmt, args)
+ char *who;
+ int code;
+ char *fmt;
+ va_list args;
+{
+ char buf[BUFSIZ], *cp;
+
+ FILE _strbuf;
+
+ (void) strcpy(buf, who);
+ for (cp = buf; *cp; cp++);
+ *cp++ = ':';
+ *cp++ = ' ';
+ if (code) {
+ (void) strcpy(cp, error_message(code));
+ while (*cp)
+ cp++;
+ }
+ _strbuf._flag = _IOWRT + _IOSTRG;
+ _strbuf._ptr = cp;
+ _strbuf._cnt = BUFSIZ - (cp - buf);
+ _doprnt(fmt, args, &_strbuf);
+ (void) putc('\0', &_strbuf);
+ Put_message(buf);