$OpenBSD: patch-src_Editor_cxx,v 1.1.1.1 2003/08/14 18:24:30 sturm Exp $ --- src/Editor.cxx.orig 2003-08-14 01:19:02.000000000 +1000 +++ src/Editor.cxx 2003-08-14 01:19:03.000000000 +1000 @@ -1583,10 +1583,10 @@ void Editor::PaintSelMargin(Surface *sur char number[100]; number[0] = '\0'; if (firstSubLine) - sprintf(number, "%d", lineDoc + 1); + snprintf(number, sizeof(number), "%d", lineDoc + 1); if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) { int lev = pdoc->GetLevel(lineDoc); - sprintf(number, "%c%c %03X %03X", + snprintf(number, sizeof(number), "%c%c %03X %03X", (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_', (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_', lev & SC_FOLDLEVELNUMBERMASK, @@ -2764,7 +2764,7 @@ long Editor::FormatRange(bool draw, Rang (ypos + vsPrint.lineHeight <= pfr->rc.bottom) && (visibleLine >= 0)) { char number[100]; - sprintf(number, "%d" lineNumberPrintSpace, lineDoc + 1); + snprintf(number, sizeof(number), "%d" lineNumberPrintSpace, lineDoc + 1); PRectangle rcNumber = rcLine; rcNumber.right = rcNumber.left + lineNumberWidth; // Right justify