Set AVFMT_FLAG_GENPTS if -correct-pts is used.
[mplayer.git] / osdep / setenv.c
blobe0ef9a35bcde74bc16dd03dc7c3b4ece05915041
1 /* setenv implementation for systems lacking it. */
3 #include "../config.h"
5 #ifndef HAVE_SETENV
7 #include <stdlib.h>
8 #include <string.h>
9 #ifndef MP_DEBUG
10 #define NDEBUG
11 #endif
12 #include <assert.h>
14 int setenv(const char *name, const char *val, int overwrite)
16 int len = strlen(name) + strlen(val) + 2;
17 char *env = malloc(len);
18 if (!env) { return -1; }
20 assert(overwrite != 0);
22 strcpy(env, name);
23 strcat(env, "=");
24 strcat(env, val);
25 putenv(env);
27 return 0;
29 #endif