|
#include "headers.h"
|
|
|
|
const char REQ_GOPH[] =
|
|
{
|
|
"%s\n"
|
|
};
|
|
|
|
|
|
int reqgen_gopher(const char *path, char **nbuf)
|
|
{
|
|
int buflen;
|
|
|
|
buflen = (strlen(REQ_GOPH) + strlen(path) + 1);
|
|
|
|
if( !(*nbuf = calloc(buflen, sizeof(char))))
|
|
{
|
|
return(ERRMEM);
|
|
}
|
|
|
|
sprintf(*nbuf, REQ_GOPH, path);
|
|
|
|
|
|
return(0);
|
|
}
|