* Hook output functions (like printf(3)) with LD_PRELOAD to color stderr (or
* other file descriptors).
*
- * Copyright (C) 2013-2014 Simon Ruderich
+ * Copyright (C) 2013-2018 Simon Ruderich
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
HOOK_FUNC_DEF3(int, execve, char const *, filename, char * const *, argv, char * const *, env) {
DLSYM_FUNCTION(real_execve, "execve");
+ char * const fake_env[] = {NULL};
+ if (env == NULL) {
+ env = fake_env;
+ }
+
/* Count environment variables. */
size_t count = 0;
char * const *x = env;