Fixed bug on memory allocation for string types and fixed linker problem on example main program

This commit is contained in:
Jan Lindström
2013-07-02 07:09:44 +03:00
parent b51232c518
commit 471b3cbaf2
8 changed files with 37 additions and 19 deletions

View File

@ -3,6 +3,7 @@
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv)
{
@ -24,7 +25,8 @@ int main(int argc, char** argv)
if ( strncmp("mysql://", uri, 8) == 0) {
mrl[i].server_url = uri;
mrl[k].server_url = malloc(strlen(uri)+1);
strcpy(mrl[k].server_url, uri);
k++;
if (argc == 1) {