Skip to content

Commit

Permalink
Fix printing of class names in llvmrt
Browse files Browse the repository at this point in the history
The name length was being used as the field width, not the precision
  • Loading branch information
greedy committed Jul 26, 2011
1 parent 62ccb15 commit 2a34090
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/llvmrt/runtime.c
Expand Up @@ -9,7 +9,7 @@

static void printclassname(FILE* f, struct klass *klass)
{
fprintf(f, "%*s", klass->name.len, klass->name.bytes);
fprintf(f, "%.*s", klass->name.len, klass->name.bytes);
}

struct java_lang_Object *rt_new(struct klass *klass)
Expand Down Expand Up @@ -122,7 +122,7 @@ void rt_assertNotNull(struct java_lang_Object *object)

void rt_printexception(struct java_lang_Object *object)
{
fprintf(stderr, "Uncaught exception: %*s\n", object->klass->name.len, object->klass->name.bytes);
fprintf(stderr, "Uncaught exception: %.*s\n", object->klass->name.len, object->klass->name.bytes);
}

void *rt_argvtoarray(int argc, char **argv)
Expand Down

0 comments on commit 2a34090

Please sign in to comment.