diff options
author | Frederic Cambus <fcambus@cvs.openbsd.org> | 2020-07-17 07:58:47 +0000 |
---|---|---|
committer | Frederic Cambus <fcambus@cvs.openbsd.org> | 2020-07-17 07:58:47 +0000 |
commit | 8ea8350f9052b02a54fc2a56a50caf9360268f99 (patch) | |
tree | af06127f6e3824f57cc20c1ad3d5995755279118 /sys/dev/rasops | |
parent | dcf8ef35390c7c45297bf9b98defe33f1b04165f (diff) |
Merge the two if blocks checking if the font in use contains a given
character in rasops_mapchar().
OK kn@, cheloha@
Diffstat (limited to 'sys/dev/rasops')
-rw-r--r-- | sys/dev/rasops/rasops.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 87dbe409d95..b0b14765df3 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.63 2020/07/11 15:02:52 fcambus Exp $ */ +/* $OpenBSD: rasops.c,v 1.64 2020/07/17 07:58:46 fcambus Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -532,13 +532,8 @@ rasops_mapchar(void *cookie, int c, u_int *cp) } } - - if (c < ri->ri_font->firstchar) { - *cp = '?'; - return (0); - } - - if (c - ri->ri_font->firstchar >= ri->ri_font->numchars) { + if (c < ri->ri_font->firstchar || + c - ri->ri_font->firstchar >= ri->ri_font->numchars) { *cp = '?'; return (0); } |