Skip to content

Commit

Permalink
buf_size -> len
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jan 31, 2012
1 parent 5a8083d commit 959009b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/color.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ rgba_create(uint32_t rgba) {
*/

void
rgba_to_string(rgba_t rgba, char *buf, size_t buf_size) {
rgba_to_string(rgba_t rgba, char *buf, size_t len) {
if (1 == rgba.a) {
snprintf(buf, buf_size, "#%.2x%.2x%.2x"
snprintf(buf, len, "#%.2x%.2x%.2x"
, (int) (rgba.r * 255)
, (int) (rgba.g * 255)
, (int) (rgba.b * 255));
} else {
snprintf(buf, buf_size, "rgba(%d, %d, %d, %.2f)"
snprintf(buf, len, "rgba(%d, %d, %d, %.2f)"
, (int) (rgba.r * 255)
, (int) (rgba.g * 255)
, (int) (rgba.b * 255)
Expand Down
2 changes: 1 addition & 1 deletion src/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int32_t
rgba_from_string(const char *str, short *ok);

void
rgba_to_string(rgba_t rgba, char *buf, size_t buf_size);
rgba_to_string(rgba_t rgba, char *buf, size_t len);

void
rgba_inspect(int32_t rgba);
Expand Down

0 comments on commit 959009b

Please sign in to comment.