Project

General

Profile

Bug #135

Magic number

Added by Sylvain Laperche almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
05/29/2012
Due date:
% Done:

0%

Estimated time:

Description

In utils.c, function chk_html_colorcode, we can see
if (strlen(color) != 6)
and
for (i = 0; i < 6; i++)

It's better to replace the magic number 6 by a named constant (or define).

History

#1

Updated by Robin Hahling almost 8 years ago

  • Target version set to 3.0.0
#2

Updated by Robin Hahling almost 8 years ago

In which file would you declare this magic number? It does not make sense outside of util.c so maybe not in extern.h.
And do you really think it is worth it as this number is only being used twice?

#3

Updated by Robin Hahling almost 8 years ago

  • Status changed from New to Closed
  • Assignee set to Robin Hahling

Finally, as color are already defined in extern.h, I define it there.

Also available in: Atom PDF