martinotten / pixelcity

Automatically exported from code.google.com/p/pixelcity
0 stars 0 forks source link

glRgba uses strncmp where is should have been strncpy #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The function glRgba in glRgba.cpp is called strncmp instead of strncpy:

GLrgba glRgba (char* string)
{

  long    color;
  char    buffer[10];
  char*   pound;
  GLrgba  result;

  strncmp (buffer, string, 10);
  if (pound = strchr (buffer, '#'))
...

Original issue reported on code.google.com by jesper@jesperhansen.net on 15 Jul 2011 at 8:02

GoogleCodeExporter commented 9 years ago
There is also a mixup of the channels:
  result.red = (float)GetBValue (color) / 255.0f;
  result.green = (float)GetGValue (color) / 255.0f;
  result.blue = (float)GetRValue (color) / 255.0f;

Original comment by jesper@jesperhansen.net on 15 Jul 2011 at 8:04