core: Fix compile warnings.

* lib/libmes.c: Fix warning.
* src/posix.c (execl_): Fix warning, add debug printing.
This commit is contained in:
Jan Nieuwenhuizen 2018-06-26 06:19:51 +02:00
parent 7be16f51b3
commit 16f4adfbc2
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
2 changed files with 7 additions and 2 deletions

View file

@ -19,6 +19,7 @@
*/
#include <libmes.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

View file

@ -279,14 +279,18 @@ execl_ (SCM file_name, SCM args) ///((name . "execl"))
cons (file_name,
cons (MAKE_STRING (cstring_to_list ("too many arguments")),
cons (file_name, args))));
c_argv[i++] = string_to_cstring_ (file_name, string_to_cstring_buf+n);
c_argv[i++] = (char*)string_to_cstring_ (file_name, string_to_cstring_buf+n);
n += length__ (STRING (file_name)) + 1;
while (args != cell_nil)
{
assert (TYPE (CAR (args)) == TSTRING);
c_argv[i++] = string_to_cstring_ (CAR (args), string_to_cstring_buf+n);
c_argv[i++] = (char*)string_to_cstring_ (CAR (args), string_to_cstring_buf+n);
n += length__ (STRING (CAR (args))) + 1;
args = CDR (args);
if (g_debug > 2)
{
eputs ("arg["); eputs (itoa (i)); eputs ("]: "); eputs (c_argv[i-1]); eputs ("\n");
}
}
c_argv[i] = 0;
return MAKE_NUMBER (execv (c_argv[0], c_argv));