From: Alexey Tourbin <at@altlinux.ru>
To: devel@lists.altlinux.org
Subject: Re: [devel] не собирается toppler. Прошу помощи.
Date: Thu, 6 Aug 2009 10:37:39 +0400
Message-ID: <20090806063739.GB3837@altlinux.org> (raw)
In-Reply-To: <4A7A7600.9010903@altlinux.org>
[-- Attachment #1: Type: text/plain, Size: 2406 bytes --]
On Thu, Aug 06, 2009 at 10:19:44AM +0400, "Шишков Е.В." wrote:
> Всем привет.
>
> Был в отпуске. Пока отдыхал, перестал
> пакетик мой собираться (toppler).
> Попытался починить - не получается.
>
> leveledit.o leveledit.cc
> leveledit.cc: In function 'void le_edit()':
> leveledit.cc:519: warning: deprecated conversion from string constant to
> 'char*'
> In file included from /usr/include/stdio.h:912,
> from decl.h:24,
> from leveledit.cc:21:
> In function 'int snprintf(char*, size_t, const char*, ...)',
> inlined from 'void le_showkeyhelp(int, int)' at leveledit.cc:439,
> inlined from 'void le_edit()' at leveledit.cc:935:
> /usr/include/bits/stdio2.h:66: error: call to int
> __builtin___snprintf_chk(char*, unsigned int, int, unsigned int, const
> char*, ...) will always overflow destination buffer
leveledit.cc:
411 static void le_showkeyhelp(int row, int col) {
412 int k;
413 int maxkeylen = 0;
414 textsystem *ts = new textsystem(_("Editor Key Help"), editor_background_menu_proc);
415 char tabbuf1[6], tabbuf2[6];
416
417 if (!ts) return;
418
419 for (k = 0; k < SIZE(_ed_keys); k++) {
420 char knam[256];
421 snprintf(knam, 256, "%s%s", keymod2str(_ed_keys[k].mod), SDL_GetKeyName(_ed_keys[k].key));
422 int l = scr_textlength(knam);
423
424 if (l > maxkeylen) maxkeylen = l;
425 }
426
427 snprintf(tabbuf1, 6, "%3i", maxkeylen + FONTWID);
428 if (tabbuf1[0] < '0') tabbuf1[0] = '0';
429 if (tabbuf1[1] < '0') tabbuf1[1] = '0';
430 if (tabbuf1[2] < '0') tabbuf1[2] = '0';
431
432 for (k = 0; k < SIZE(_ed_keys); k++) {
433 char buf[256];
434 char tmpb[256];
435 char knam[256];
436
437 snprintf(knam, 256, "%s%s", keymod2str(_ed_keys[k].mod), SDL_GetKeyName(_ed_keys[k].key));
438
439 snprintf(tabbuf2, 256, "%3i", maxkeylen - scr_textlength(knam));
440 if (tabbuf2[0] < '0') tabbuf2[0] = '0';
441 if (tabbuf2[1] < '0') tabbuf2[1] = '0';
442 if (tabbuf2[2] < '0') tabbuf2[2] = '0';
В строке 439 у sprintf неправильный аргумент "размер буфера":
буфер объявлен как tabbuf2[6] (строка 415), а печатают в него
как будто он 256 байтов.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-08-06 6:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 6:19 "Шишков Е.В."
2009-08-06 6:37 ` Alexey Tourbin [this message]
2009-08-06 7:39 ` "Шишков Е.В."
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090806063739.GB3837@altlinux.org \
--to=at@altlinux.ru \
--cc=devel@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git