$OpenBSD: patch-sh_func_c,v 1.3 2018/09/10 16:23:27 sthen Exp $

From d8b47bd1934d1d9cb603e562b149bba2816d90ca Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Mon, 28 Nov 2016 17:14:20 +0000
Subject: [PATCH] Fix type of read in prompt confirmation (eg. rmstar) (David
 Kaspar)

Index: sh.func.c
--- sh.func.c.orig
+++ sh.func.c
@@ -2734,16 +2734,18 @@ nlsclose(void)
 int
 getYN(const char *prompt)
 {
-    int doit, c;
+    int doit;
+    char c;
+
     xprintf("%s", prompt);
     flush();
-    (void) force_read(SHIN, &c, 1);
+    (void) force_read(SHIN, &c, sizeof(c));
     /* 
      * Perhaps we should use the yesexpr from the
      * actual locale
      */
     doit = (strchr(CGETS(22, 14, "Yy"), c) != NULL);
-    while (c != '\n' && force_read(SHIN, &c, 1) == 1)
+    while (c != '\n' && force_read(SHIN, &c, sizeof(c)) == sizeof(c))
 	continue;
     return doit;
 }
