[PATCH 02 of 55 RFC c-hglib:level1] c-hglib: all level 0 functions, provided for context

David Soria Parra dsp at experimentalworks.net
Sun Sep 15 15:37:17 CDT 2013


On 09/14/2013 02:35 AM, Iulian Stana wrote:

> +/*
> + * Open the connection with the mercurial command server.
> + * */
> +hg_handle *hg_open(const char *path, char *encoding)
> +{
> +	hg_handle *handle = malloc(sizeof(hg_handle));
> +	handle->header = malloc(sizeof(hg_header));
> +	char command[100];

Just a small remark. I personally wouldn't allocate a fixed sized
string. Either check if command exceeds 100 (including \0) or call
realloc if necessary.


More information about the Mercurial-devel mailing list