Mail Archives: djgpp/1998/07/20/12:42:40
Hi folks,
I'm attempting to write a html post form handler class and it always
fails with a call to strtoul(). Can someone help figure this out?
Code follows... and TIA!!
#include <iostream.h>
#include <stdlib.h>
void setup() {putenv("CONTENT_LENGHT=12345");} // For testing...
class CGIApost
{
public:
CGIApost();
private:
char **query;
};
CGIApost::CGIApost()
{
setup();
char *endptr;
const char *l = getenv("CONTENT_LENGTH");
unsigned long length;
length = strtoul(l, &endptr, 10); // <-- Fails here
cout << length << endl;
}
int main()
{
CGIApost c;
return 0;
}
- Raw text -