Skip to content
Snippets Groups Projects
Commit c7b9733a authored by Niels Möller's avatar Niels Möller
Browse files

Type check in f_update()

Rev: src/modules/_Crypto/md5.c:1.6
Rev: src/modules/_Crypto/sha.c:1.7
parent 2ac3726c
Branches
Tags
No related merge requests found
/* /*
* $Id: md5.c,v 1.5 1997/08/26 08:19:16 nisse Exp $ * $Id: md5.c,v 1.6 1997/09/07 19:51:57 nisse Exp $
* *
* A pike module for getting access to some common cryptos. * A pike module for getting access to some common cryptos.
* *
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "interpret.h" #include "interpret.h"
#include "program.h" #include "program.h"
#include "error.h" #include "error.h"
#include "module_support.h"
#include "md5.h" #include "md5.h"
...@@ -56,7 +57,10 @@ static void f_create(INT32 args) ...@@ -56,7 +57,10 @@ static void f_create(INT32 args)
static void f_update(INT32 args) static void f_update(INT32 args)
{ {
md5_update(THIS, (unsigned INT8 *) (sp-args)->u.string->str, (sp-args)->u.string->len); struct pike_string *s;
get_all_args("_Crypto.md5->update", args, "%S", &s);
md5_update(THIS, (unsigned INT8 *) s->str, s->len);
pop_n_elems(args); pop_n_elems(args);
push_object(this_object()); push_object(this_object());
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "interpret.h" #include "interpret.h"
#include "program.h" #include "program.h"
#include "error.h" #include "error.h"
#include "module_support.h"
#include "sha.h" #include "sha.h"
...@@ -49,7 +50,10 @@ static void f_create(INT32 args) ...@@ -49,7 +50,10 @@ static void f_create(INT32 args)
static void f_update(INT32 args) static void f_update(INT32 args)
{ {
sha_update(THIS, (unsigned INT8 *) (sp-args)->u.string->str, (sp-args)->u.string->len); struct pike_string *s;
get_all_args("_Crypto.sha->update", args, "%S", &s);
sha_update(THIS, (unsigned INT8 *) s->str, s->len);
pop_n_elems(args); pop_n_elems(args);
push_object(this_object()); push_object(this_object());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment