diff --git a/Source/script.cpp b/Source/script.cpp index b0577c90..be14c182 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -5162,7 +5162,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) ent.which=EW_FGETS; ent.offsets[0]=GetUserVarIndex(line, 1); // file handle ent.offsets[1]=GetUserVarIndex(line, 2); // output string - ent.offsets[2]=add_string(line.gettoken_str(3)[0]?line.gettoken_str(3):"1023"); + if (line.gettoken_str(3)[0]) + ent.offsets[2]=add_string(line.gettoken_str(3)); + else + ent.offsets[2]=add_intstring(NSIS_MAX_STRLEN-1); if (ent.offsets[0]<0 || ent.offsets[1]<0) PRINTHELP() SCRIPT_MSG("FileRead: %s->%s (max:%s)\n",line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3)); return add_entry(&ent);