Skip to content

Commit

Permalink
Check stringbuilder length before truncating it
Browse files Browse the repository at this point in the history
  • Loading branch information
pulb committed Oct 3, 2016
1 parent 9c23b51 commit c163793
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions aggregate-avatars.vala
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ void main()
}
}

stdout.printf(sb.truncate(sb.len - 1).str);
stdout.flush();
if (sb.len > 0)
{
stdout.printf(sb.truncate(sb.len - 1).str);
stdout.flush();
}

mainloop.quit();

return false;
Expand Down

0 comments on commit c163793

Please sign in to comment.