Permalink
Browse files

can: print multiple values

  • Loading branch information...
1 parent e2efb3c commit 7f20adbd99f3ec7eb608b5a95fcc5a72d8a9683b @indutny committed Jun 30, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/can.cc
View
@@ -83,11 +83,13 @@ candor::Value* APIAssert(uint32_t argc, candor::Value* argv[]) {
candor::Value* APIPrint(uint32_t argc, candor::Value* argv[]) {
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();
}

0 comments on commit 7f20adb

Please sign in to comment.