openbsd-ports/editors/scite/patches/patch-gtk_DirectorExtension_cxx
sturm a0dfeaa0c2 Initial import of scite 1.54
SciTE is short for SCIntillla based Text Editor. It is a very
flexible but still small and fast editor providing block folding,
syntax highlighting, regular expression search & replace etc.

WWW: http://www.scintilla.org/SciTE.html

from Joerg Sonnenberger <joerg@bec.de> with patches from Andrew Dalgleish
2003-08-14 18:27:25 +00:00

29 lines
1.3 KiB
Plaintext

$OpenBSD: patch-gtk_DirectorExtension_cxx,v 1.1.1.1 2003/08/14 18:27:25 sturm Exp $
--- gtk/DirectorExtension.cxx.orig 2003-08-13 17:49:48.000000000 +1000
+++ gtk/DirectorExtension.cxx 2003-08-13 18:15:11.000000000 +1000
@@ -240,6 +240,7 @@ bool DirectorExtension::CreatePipe(bool
bool tryStandardPipeCreation = false;
SString pipeFilename = host->Property("ipc.scite.name");
gchar* pipeName = NULL;
+ size_t pipeName_size = 0;
fdReceiver = -1;
inputWatcher = -1;
@@ -249,6 +250,7 @@ bool DirectorExtension::CreatePipe(bool
printf("CreatePipe: if (pipeFilename.size() > 0): %s\n", pipeFilename.c_str());
//snprintf(pipeName, CHAR_MAX - 1, "%s", pipeFilename.c_str());
pipeName = g_strdup(pipeFilename.c_str());
+ pipeName_size = strlen(pipeName) + 1;
fdReceiver = open(pipeName, O_RDWR | O_NONBLOCK);
if (fdReceiver == -1 && errno == EACCES) {
//fprintf(fdDebug, "CreatePipe: No access\n");
@@ -296,7 +298,7 @@ bool DirectorExtension::CreatePipe(bool
//create the pipe name - we use a number as well just incase multiple people have pipes open
//or we are forceing a new instance of scite (even if there is already one)
- sprintf(pipeName, "/tmp/.SciTE.%d.ipc", i);
+ snprintf(pipeName, pipeName_size, "/tmp/.SciTE.%d.ipc", i);
//fprintf(fdDebug, "Trying pipe %s\n", pipeName);
//check to see if there is already one