diff options
author | Manuel Reimer <manuel.reimer@gmx.de> | 2020-08-14 19:32:56 +0200 |
---|---|---|
committer | Manuel Reimer <manuel.reimer@gmx.de> | 2020-08-14 19:32:56 +0200 |
commit | f7c99bb716a4b628dd853e5e25f9507a0860928b (patch) | |
tree | cf400e1f08a72b3bc5cb6bd8181e1ae78b20db93 /glcdskin/object.c | |
parent | 808d5f865bd9e85cb841b5219e6a9622694ab2da (diff) | |
download | graphlcd-base-f7c99bb716a4b628dd853e5e25f9507a0860928b.tar.gz graphlcd-base-f7c99bb716a4b628dd853e5e25f9507a0860928b.tar.bz2 |
skin object: Reserve proper amount of memory for position data
Fixes "output may be truncated" warning
Diffstat (limited to 'glcdskin/object.c')
-rw-r--r-- | glcdskin/object.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/glcdskin/object.c b/glcdskin/object.c index 586251a..70224f9 100644 --- a/glcdskin/object.c +++ b/glcdskin/object.c @@ -1070,7 +1070,7 @@ void cSkinObject::Render(GLCD::cBitmap * screen) for (int j = 1; j < (int) NumObjects(); j++) { int px, py, ph,pw; - char buf[10]; + char buf[11]; const cSkinObject * o = GetObject(j); cSkinObject obj(*o); obj.SetListIndex(maxitems, i); @@ -1080,13 +1080,13 @@ void cSkinObject::Render(GLCD::cBitmap * screen) py = obj.Pos().y + Pos().y + yoffset; // obj.mPos1.y += mPos1.y + yoffset; ph = o->Size().h; // obj.mPos2.y += mPos1.y + yoffset; pw = o->Size().w; - snprintf(buf, 9, "%d", px); obj.mX1.Parse((const char*)buf); - snprintf(buf, 9, "%d", py); obj.mY1.Parse((const char*)buf); + snprintf(buf, 11, "%d", px); obj.mX1.Parse((const char*)buf); + snprintf(buf, 11, "%d", py); obj.mY1.Parse((const char*)buf); if (ph > 0) { - snprintf(buf, 9, "%d", ph); obj.mHeight.Parse((const char*)buf); + snprintf(buf, 11, "%d", ph); obj.mHeight.Parse((const char*)buf); } - snprintf(buf, 9, "%d", pw); obj.mWidth.Parse((const char*)buf); + snprintf(buf, 11, "%d", pw); obj.mWidth.Parse((const char*)buf); obj.Render(screen); } yoffset += itemheight; |