Skip to content
Snippets Groups Projects
Commit 424e9957 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Improved error message.

Rev: src/module_support.c:1.13
parent b5087743
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "pike_types.h" #include "pike_types.h"
#include "error.h" #include "error.h"
RCSID("$Id: module_support.c,v 1.12 1998/05/25 10:38:45 hubbe Exp $"); RCSID("$Id: module_support.c,v 1.13 1998/09/25 18:06:34 grubba Exp $");
/* Checks that args_to_check arguments are OK. /* Checks that args_to_check arguments are OK.
* Returns 1 if everything worked ok, zero otherwise. * Returns 1 if everything worked ok, zero otherwise.
...@@ -236,7 +236,13 @@ void get_all_args(char *fname, INT32 args, char *format, ... ) ...@@ -236,7 +236,13 @@ void get_all_args(char *fname, INT32 args, char *format, ... )
case '*': expected_type = "mixed"; break; case '*': expected_type = "mixed"; break;
default: expected_type = "Unknown"; break; default: expected_type = "Unknown"; break;
} }
error("Bad argument %d to %s(). Expected %s\n", ret+1, fname, if (ret <= args) {
expected_type); error("Bad argument %d to %s(). Expected %s\n",
ret+1, fname, expected_type);
} else if (args*2 < strlen(format)) {
error("Too few arguments to %s(). Expected %d arguments, got %d.\n"
"The type of the next argument is expected to be %s\n",
fname, strlen(format)/2, args, expected_type);
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment