Commit f8210ab5 authored by Vikram Narayanan's avatar Vikram Narayanan
Browse files

tools/idl: Give distinct names to generated files



Files generated by the compiler had same name for
client and server source. Fix that.

Signed-off-by: Vikram Narayanan's avatarVikram Narayanan <vikram186@gmail.com>
parent 3c160f14
......@@ -95,10 +95,10 @@ int main(int argc, char ** argv)
exit(0);
}
char* of_name = (char*) malloc(sizeof(char)*(strlen(m->identifier())+3));
char* of_name = (char*) malloc(sizeof(char)*(strlen(m->identifier())+10));
std::ostringstream total;
total << m->identifier() << ".c";
strncpy(of_name, total.str().c_str(), strlen(m->identifier())+3);
total << m->identifier() << "_server.c";
strncpy(of_name, total.str().c_str(), strlen(m->identifier())+10);
FILE *of = fopen(of_name, "w");
if(!of)
......@@ -148,10 +148,10 @@ int main(int argc, char ** argv)
exit(0);
}
char* of_name = (char*) malloc(sizeof(char)*(strlen(m->identifier())+3));
char* of_name = (char*) malloc(sizeof(char)*(strlen(m->identifier())+10));
std::ostringstream total;
total << m->identifier() << ".c";
strncpy(of_name, total.str().c_str(), strlen(m->identifier())+3);
total << m->identifier() << "_client.c";
strncpy(of_name, total.str().c_str(), strlen(m->identifier())+10);
FILE *of = fopen(of_name, "w");
if(!of)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment