Fix title handling
This commit is contained in:
parent
3021529d92
commit
b7203383a7
3 changed files with 9 additions and 5 deletions
8
lib.c
8
lib.c
|
@ -1,10 +1,14 @@
|
|||
#include "fenster/fenster.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
struct fenster *fenster_init(int width, int height, char *title) {
|
||||
struct fenster *fenster_init(int width, int height, int title_length,
|
||||
char title[title_length]) {
|
||||
uint32_t *buf = calloc(width * height, sizeof(uint32_t));
|
||||
char *title_init = malloc(title_length);
|
||||
memcpy(title_init, title, title_length);
|
||||
struct fenster f_init = {
|
||||
.title = title,
|
||||
.title = title_init,
|
||||
.width = width,
|
||||
.height = height,
|
||||
.buf = buf,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue