Previous 15994 Revisions Next

r7404 Wednesday 17th February, 2010 at 20:18:19 UTC by Firewave
[MESSUI] Fixed array length passed into functions
[src/osd/winui]picker.c properties.c

src/osd/winui/picker.c
r7403r7404
11931193      return lpszLong;
11941194
11951195   lstrcpy(szShort, lpszLong);
1196   GetTextExtentPoint32(hDC, szThreeDots, sizeof(szThreeDots), &size);
1196   GetTextExtentPoint32(hDC, szThreeDots, ARRAY_LENGTH(szThreeDots), &size);
11971197   nAddLen = size.cx;
11981198
11991199   for (i = nStringLen - 1; i > 0; i--)
r7403r7404
12801280
12811281   /* Labels are offset by a certain amount */
12821282   /* This offset is related to the width of a space character */
1283   GetTextExtentPoint32(hDC, TEXT(" "), 1 , &size);
1283   GetTextExtentPoint32(hDC, TEXT(" "), 1, &size);
12841284   offset = size.cx;
12851285
12861286   lvi.mask      = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE | LVIF_PARAM;
src/osd/winui/properties.c
r7403r7404
15301530         TCHAR buffer[200];
15311531         char buffer2[200];
15321532
1533         Edit_GetText(hCtrl,buffer,sizeof(buffer));
1533         Edit_GetText(hCtrl, buffer, ARRAY_LENGTH(buffer));
15341534         _stscanf(buffer,TEXT("%d"),&n);
15351535
1536         Edit_GetText(hCtrl2,buffer,sizeof(buffer));
1536         Edit_GetText(hCtrl2, buffer, ARRAY_LENGTH(buffer));
15371537         _stscanf(buffer,TEXT("%d"),&d);
15381538
15391539         if (n == 0 || d == 0)
r7403r7404
15421542            d = 3;
15431543         }
15441544
1545         snprintf(buffer2,sizeof(buffer2),"%d:%d",n,d);
1545         snprintf(buffer2, sizeof(buffer2), "%d:%d", n, d);
15461546         options_set_string(o, aspect_option, buffer2, OPTION_PRIORITY_CMDLINE);
15471547      }
15481548   }
r7403r7404
15631563         TCHAR buffer[200];
15641564         char buffer2[200];
15651565
1566         Edit_GetText(hCtrl,buffer,sizeof(buffer));
1567         _stscanf(buffer,TEXT("%d"),&width);
1566         Edit_GetText(hCtrl, buffer, ARRAY_LENGTH(buffer));
1567         _stscanf(buffer, TEXT("%d"), &width);
15681568
1569         Edit_GetText(hCtrl2,buffer,sizeof(buffer));
1570         _stscanf(buffer,TEXT("%d"),&height);
1569         Edit_GetText(hCtrl2, buffer, ARRAY_LENGTH(buffer));
1570         _stscanf(buffer, TEXT("%d"), &height);
15711571
15721572         if (width == 0 || height == 0)
15731573         {
r7403r7404
15751575            height = 480;
15761576         }
15771577
1578         snprintf(buffer2,sizeof(buffer2),"%dx%d",width,height);
1578         snprintf(buffer2, sizeof(buffer2), "%dx%d", width, height);
15791579         options_set_string(o, OPTION_SNAPSIZE, buffer2, OPTION_PRIORITY_CMDLINE);
15801580      }
15811581   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team