Browse Source

* const on errstr ptr

master
Alex 'AdUser' Z 10 years ago
parent
commit
48e8701fe4
  1. 3
      src/image.c
  2. 2
      src/image.h
  3. 3
      src/test-image.c

3
src/image.c

@ -18,10 +18,11 @@
#include <magic.h>
#include "main.h"
#include "bitmap.h"
#include "image.h"
image_t *
image_from_file(const char *path, char **errstr)
image_from_file(const char *path, const char **errstr)
{
const char *mimetype;
magic_t magic;

2
src/image.h

@ -6,6 +6,6 @@ typedef struct
} image_t;
image_t *
image_from_file(const char *path, char **errstr);
image_from_file(const char *path, const char **errstr);
#endif
#define HAS_IMAGE_H

3
src/test-image.c

@ -1,11 +1,12 @@
#include <gd.h>
#include "main.h"
#include "bitmap.h"
#include "image.h"
int main(int argc, char **argv) {
image_t *img = NULL;
char *err;
const char *err = NULL;
img = image_from_file("test.png", &err);
if (img == NULL) {

Loading…
Cancel
Save