Skip to content

Commit

Permalink
fixed pobug in ofToString when passing an empty vector. i suppose thi…
Browse files Browse the repository at this point in the history
…s is where people usually use boost or poco to cover all the bases.
  • Loading branch information
kylemcdonald committed Jul 21, 2011
1 parent a678fa0 commit 378c34d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libs/openFrameworks/utils/ofUtils.h
Expand Up @@ -92,10 +92,13 @@ string ofToString(const vector<T>& values) {
stringstream out;
int n = values.size();
out << "{";
for(int i = 0; i < n - 1; i++) {
out << values[i] << ", ";
if(n > 0) {
for(int i = 0; i < n - 1; i++) {
out << values[i] << ", ";
}
out << values[n - 1];
}
out << values[n - 1] << "}";
cout << "}";
return out.str();
}

Expand Down

0 comments on commit 378c34d

Please sign in to comment.