Hi, everyone. I'm tearing my hair out. The second printf statement segfaults. Printed on the screen is:
BeforeLibcurlinitializedsuccessfully
Segmentation fault
Code:
#include "curl/curl.h" /* /usr/include/curl/curl.h comes with package libcurl4-dev */
#include <stdio.h>
#include <string.h>
#include "Error.h"
#define StringMax 100
static unsigned int libcurlinitialized = 0 ;
int initializeinternetfunctions ( void )
{
char Message2 [] = "Libcurl initialized successfully.\n" ;
printf("Before");
int z = printf ( "%s" , Message2 ) ;
printf("After");
if ( z != strlen ( Message2 ) )
{
ErrorMessage ( "Couldn't print to screen." , __FILE__ , __LINE__ );
return -1;
}
return 0 ;
}