From 0f6deb5d9c841485f3dcf107cc27cba18a468304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Wed, 6 Aug 1997 11:41:55 -0700 Subject: [PATCH] crypt now returns 0 if salt is less than 2 chars long (instead of error) Rev: src/builtin_functions.c:1.38 --- src/builtin_functions.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index b5f30fe757..83b9389d52 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.37 1997/05/19 23:31:00 hubbe Exp $"); +RCSID("$Id: builtin_functions.c,v 1.38 1997/08/06 18:41:55 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -668,7 +668,11 @@ void f_crypt(INT32 args) { if(sp[1-args].type != T_STRING || sp[1-args].u.string->len < 2) - error("Bad argument 2 to crypt()\n"); + { + pop_n_elems(args); + push_int(0); + return; + } saltp=sp[1-args].u.string->str; } else { -- GitLab