c-ipfs/commands/command_option.c
John Jones 50ffade515 More work on storage and cleanup
Added flatfs, as well as fixed some memory leaks. Valgrind across tests
now reports 0 memory leaks.
2016-11-28 08:09:00 -05:00

27 lines
591 B
C

//
// option.c
// c-ipfs
//
// Created by John Jones on 10/26/16.
// Copyright © 2016 JMJAtlanta. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
#include "ipfs/commands/command_option.h"
int commands_command_option_init(struct CommandOption* option, char* description) {
option->description = description;
// allocate memory for names
option->names = malloc(option->name_count * sizeof(char*));
if (option->names == NULL)
return 0;
return 1;
}
int commands_command_option_free(struct CommandOption* option) {
free(option->names);
free(option);
return 0;
}