diff --git a/tools/nxstyle.c b/tools/nxstyle.c index bdd5bd0cc5..c36c84d014 100644 --- a/tools/nxstyle.c +++ b/tools/nxstyle.c @@ -571,18 +571,6 @@ int main(int argc, char **argv, char **envp) } g_file_name = argv[optind]; - instream = fopen(g_file_name, "r"); - - if (!instream) - { - FATALFL("Failed to open", g_file_name); - return 1; - } - - /* Determine the line width */ - - g_maxline = get_line_width(instream) + excess; - rewind(instream); /* Are we parsing a header file? */ @@ -607,6 +595,19 @@ int main(int argc, char **argv, char **envp) return 0; } + instream = fopen(g_file_name, "r"); + + if (!instream) + { + FATALFL("Failed to open", g_file_name); + return 1; + } + + /* Determine the line width */ + + g_maxline = get_line_width(instream) + excess; + rewind(instream); + btabs = false; /* True: TAB characters found on the line */ bcrs = false; /* True: Carriage return found on the line */ bfunctions = false; /* True: In private or public functions */