Skip to content
Snippets Groups Projects
Commit 75692ce9 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

bugfix

Rev: src/modules/files/file.c:1.79
parent 3c0c0d5d
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define READ_BUFFER 8192 #define READ_BUFFER 8192
#include "global.h" #include "global.h"
RCSID("$Id: file.c,v 1.78 1998/03/20 22:33:16 hubbe Exp $"); RCSID("$Id: file.c,v 1.79 1998/03/22 03:25:25 hubbe Exp $");
#include "fdlib.h" #include "fdlib.h"
#include "interpret.h" #include "interpret.h"
#include "svalue.h" #include "svalue.h"
...@@ -423,6 +423,8 @@ static void file_read(INT32 args) ...@@ -423,6 +423,8 @@ static void file_read(INT32 args)
if(sp[-args].type != T_INT) if(sp[-args].type != T_INT)
error("Bad argument 1 to file->read().\n"); error("Bad argument 1 to file->read().\n");
len=sp[-args].u.integer; len=sp[-args].u.integer;
if(len<0)
error("Cannot read negative number of args.\n");
} }
if(args > 1 && !IS_ZERO(sp+1-args)) if(args > 1 && !IS_ZERO(sp+1-args))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment