All pastes #578500 Raw Edit

Something

public text v1 · immutable
·published 2007-06-20 09:35 UTC
rendered paste body
#include <string>
#include <iostream>
#include <stdlib.h>

using namespace std;

/*
============
GetHL2Path:
Gets path from VPROJECT and checks for HL2.exe
============
*/
bool GetHL2Path( char *hl2path )
{
	hl2path = getenv("vproject");
	strcat( hl2path, "\\..\\hl2.exe" );
	FILE *hl2exe = fopen( hl2path, "r" );
	if( !hl2exe )
	{
		return false;
	}
	
	return true;
}

/*
============
Main:
============
*/
int main( char pPath[_MAX_PATH] )
{
	if( !GetHL2Path( pPath ) )
	{
		cout << "Error: Couldn't get Vproject path!" << endl;
		exit( 1 );
	}

	//This is the crashy shit, doing anything at all with pPath is killing the app...
	cout << pPath << endl;

	return 0;
}