Skip to content

Commit

Permalink
can: print multiple values
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Jun 30, 2012
1 parent e2efb3c commit 7f20adb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/can.cc
Expand Up @@ -83,11 +83,13 @@ candor::Value* APIAssert(uint32_t argc, candor::Value* argv[]) {
candor::Value* APIPrint(uint32_t argc, candor::Value* argv[]) { candor::Value* APIPrint(uint32_t argc, candor::Value* argv[]) {
if (argc < 1) return candor::Nil::New(); if (argc < 1) return candor::Nil::New();


const char* value = StringToChar(argv[0]->ToString()); for (int i = 0; i < argc; i++) {
const char* value = StringToChar(argv[i]->ToString());


fprintf(stdout, "%s\n", value); fprintf(stdout, i != (argc - 1) ? "%s " : "%s\n", value);


delete value; delete value;
}


return candor::Nil::New(); return candor::Nil::New();
} }
Expand Down

0 comments on commit 7f20adb

Please sign in to comment.