Change Details
ubb-la/gui.c |
122 | 122 | static void textf(int x, int y, uint32_t color, const char *fmt, ...) |
123 | 123 | { |
124 | 124 | va_list ap; |
125 | | char *s; |
| 125 | char *tmp, *s; |
126 | 126 | uint8_t *p; |
127 | 127 | int ix, iy; |
128 | | int res; |
129 | 128 | |
130 | 129 | va_start(ap, fmt); |
131 | | res = vasprintf(&s, fmt, ap); |
| 130 | if (vasprintf(&tmp, fmt, ap) < 0) { |
| 131 | perror("vasprintf"); |
| 132 | exit(1); |
| 133 | } |
132 | 134 | va_end(ap); |
133 | | (void) res; |
134 | 135 | |
135 | | while (*s) { |
| 136 | for (s = tmp; *s; s++) { |
136 | 137 | p = gfxPrimitivesFontdata+(*s << 3); |
137 | 138 | for (iy = 0; iy != 8; iy++) { |
138 | 139 | for (ix = 0; ix != 8; ix++) |
... | ... | |
141 | 142 | p++; |
142 | 143 | } |
143 | 144 | x += 8; |
144 | | s++; |
145 | 145 | } |
| 146 | free(tmp); |
146 | 147 | } |
147 | 148 | |
148 | 149 | |
Download the corresponding diff file