X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=27536d28acea16b88ae9dab60de263c6408fcb20;hb=66556d967028a0b770e9bfcb9667389a6e994a58;hp=ca126d7448962d2a4bd175715aa6a184c0522341;hpb=034a5c8a09e23ce0a410d0c608dd7e050b83681e;p=st.git diff --git a/st.c b/st.c index ca126d7..27536d2 100644 --- a/st.c +++ b/st.c @@ -1404,9 +1404,9 @@ stty(void) if ((n = strlen(s)) > siz-1) die("stty parameter length too long\n"); *q++ = ' '; - q = memcpy(q, s, n); + memcpy(q, s, n); q += n; - siz-= n + 1; + siz -= n + 1; } *q = '\0'; if (system(cmd) != 0) @@ -3291,7 +3291,7 @@ xloadfont(Font *f, FcPattern *pattern) XftTextExtentsUtf8(xw.dpy, f->match, (const FcChar8 *) ascii_printable, - LEN(ascii_printable), &extents); + strlen(ascii_printable), &extents); f->set = NULL; f->pattern = FcPatternDuplicate(pattern); @@ -3302,7 +3302,7 @@ xloadfont(Font *f, FcPattern *pattern) f->rbearing = f->match->max_advance_width; f->height = f->ascent + f->descent; - f->width = DIVCEIL(extents.xOff, LEN(ascii_printable)); + f->width = DIVCEIL(extents.xOff, strlen(ascii_printable)); return 0; } @@ -3671,7 +3671,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x specs[numspecs].font = frc[f].font; specs[numspecs].glyph = glyphidx; specs[numspecs].x = (short)xp; - specs[numspecs].y = (short)(winy + frc[f].font->ascent); + specs[numspecs].y = (short)yp; xp += runewidth; numspecs++; }