VM_FILES[filenum] = FS_Open(va("%s", filename), modestring, false, false);
if (VM_FILES[filenum] == NULL)
+ {
+ if (developer.integer)
+ Con_Printf("fopen: %s mode %s failed\n", filename, modestring);
PRVM_G_FLOAT(OFS_RETURN) = -1;
+ }
else
+ {
+ if (developer.integer)
+ Con_Printf("fopen: %s mode %s opened as #%i\n", filename, modestring, filenum);
PRVM_G_FLOAT(OFS_RETURN) = filenum;
+ }
}
/*
Con_Printf("VM_fclose: no such file handle %i (or file has been closed) in %s\n", filenum, PRVM_NAME);
return;
}
+ if (developer.integer)
+ Con_Printf("fclose #%i\n", filenum);
FS_Close(VM_FILES[filenum]);
VM_FILES[filenum] = NULL;
}
VM_SAFEPARMCOUNT(1,VM_strzone);
in = PRVM_G_STRING(OFS_PARM0);
- out = PRVM_AllocString(strlen(in) + 1);
+ PRVM_G_INT(OFS_RETURN) = PRVM_AllocString(strlen(in) + 1, &out);
strcpy(out, in);
- PRVM_G_INT(OFS_RETURN) = PRVM_SetQCString(out);
}
/*
void VM_strunzone(void)
{
VM_SAFEPARMCOUNT(1,VM_strunzone);
- PRVM_FreeString((char *)PRVM_G_STRING(OFS_PARM0));
+ PRVM_FreeString(PRVM_G_INT(OFS_PARM0));
}
/*
for( count = 0, pos = altstr ; *pos ; pos++ ) {
if( *pos == '\\' ) {
if( !*++pos ) {
- break;
+ break;
}
} else if( *pos == '\'' ) {
count++;