Skip to content
Permalink
Browse files
Handle NULL file names.
  • Loading branch information
icculus committed Feb 10, 2009
1 parent fdcb89a commit a00d4b8d161929397e86dd1f0db8661c28c46a4e
Showing with 7 additions and 4 deletions.
  1. +7 −4 mojoshader_preprocessor.c
@@ -198,11 +198,14 @@ static int push_source(Context *ctx, const char *fname, const char *source,
return 0;
memset(state, '\0', sizeof (IncludeState));

state->filename = StrDup(ctx, fname);
if (state->filename == NULL)
if (fname != NULL)
{
Free(ctx, state);
return 0;
state->filename = StrDup(ctx, fname);
if (state->filename == NULL)
{
Free(ctx, state);
return 0;
} // if
} // if

state->included = included;

0 comments on commit a00d4b8

Please sign in to comment.