aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiltjo Posthuma2019-03-03 11:29:43 +0100
committerHiltjo Posthuma2019-03-03 11:29:43 +0100
commit666e2d2487dab15b94e8305ba70c3ea55665c8a8 (patch)
tree9254c53249f071e2b06c80b222566be5f460c56b
parentf2e83b21239aa698f504a6eef80cc38f1bc98d12 (diff)
downloadaur-666e2d2487dab15b94e8305ba70c3ea55665c8a8.tar.gz
simplify (greedy) font caching allocating a bit
POSIX says: "If ptr is a null pointer, realloc() shall be equivalent to malloc() for the specified size."
-rw-r--r--x.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/x.c b/x.c
index aa86b31ec860..5828a3b1a42e 100644
--- a/x.c
+++ b/x.c
@@ -1243,15 +1243,10 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
fontpattern = FcFontSetMatch(0, fcsets, 1,
fcpattern, &fcres);
- /*
- * Allocate memory for the new cache entry.
- */
+ /* Allocate memory for the new cache entry. */
if (frclen >= frccap) {
frccap += 16;
- if (!frc)
- frc = xmalloc(frccap * sizeof(Fontcache));
- else
- frc = xrealloc(frc, frccap * sizeof(Fontcache));
+ frc = xrealloc(frc, frccap * sizeof(Fontcache));
}
frc[frclen].font = XftFontOpenPattern(xw.dpy,