summaryrefslogtreecommitdiff
path: root/src/integration.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-05-19 20:53:52 +0000
committerBram Moolenaar <Bram@vim.org>2005-05-19 20:53:52 +0000
commit9c13b359b496c5268702776105a9f87b269e84f3 (patch)
treed010b277d0d66dadbe78a5d80b164ef0d79a49c2 /src/integration.c
parent34cdc3e32917a3812a8ec4369c64ef3e35243cfd (diff)
downloadvim-git-9c13b359b496c5268702776105a9f87b269e84f3.tar.gz
updated for version 7.0073
Diffstat (limited to 'src/integration.c')
-rw-r--r--src/integration.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/src/integration.c b/src/integration.c
index 05a9dec3f..48cac5353 100644
--- a/src/integration.c
+++ b/src/integration.c
@@ -182,7 +182,8 @@ messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2)
char buf[20];
ackNum = atoi(&cmd[4]);
- sprintf(buf, NOCATGETS("ack %d\n"), ackNum);
+ vim_snprintf(buf, sizeof(buf),
+ NOCATGETS("ack %d\n"), ackNum);
write(sd, buf, strlen(buf));
} else if (strncmp(cmd,
NOCATGETS("addMarkType "), 12) == 0) {
@@ -277,7 +278,8 @@ messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2)
file = strtok(&cmd[12], " ");
markid = atoi(strtok(NULL, " "));
line = workshop_get_mark_lineno(file, markid);
- sprintf(buf, NOCATGETS("markLine %s %d %d\n"),
+ vim_snprintf(buf, sizeof(buf),
+ NOCATGETS("markLine %s %d %d\n"),
file, markid, line);
write(sd, buf, strlen(buf));
} else if (cmd[1] == 'o' && cmd[4] == 'L' &&
@@ -302,29 +304,34 @@ messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2)
} else if (strcmp(cmd, NOCATGETS("getCurrentFile")) == 0) {
char *f = workshop_test_getcurrentfile();
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("currentFile %d %s"),
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("currentFile %d %s"),
f ? strlen(f) : 0, f ? f : "");
workshop_send_message(buffer);
} else if (strcmp(cmd, NOCATGETS("getCursorRow")) == 0) {
int row = workshop_test_getcursorrow();
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("cursorRow %d"), row);
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("cursorRow %d"), row);
workshop_send_message(buffer);
} else if (strcmp(cmd, NOCATGETS("getCursorCol")) == 0) {
int col = workshop_test_getcursorcol();
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("cursorCol %d"), col);
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("cursorCol %d"), col);
workshop_send_message(buffer);
} else if (strcmp(cmd, NOCATGETS("getCursorRowText")) == 0) {
char *t = workshop_test_getcursorrowtext();
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("cursorRowText %d %s"),
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("cursorRowText %d %s"),
t ? strlen(t) : 0, t ? t : "");
workshop_send_message(buffer);
} else if (strcmp(cmd, NOCATGETS("getSelectedText")) == 0) {
char *t = workshop_test_getselectedtext();
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("selectedText %d %s"),
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("selectedText %d %s"),
t ? strlen(t) : 0, t ? t : "");
workshop_send_message(buffer);
#endif
@@ -709,7 +716,7 @@ void workshop_connect(XtAppContext context)
char buf[BUFSIZ];
unlink(file);
- sprintf(buf, "date > %s", file);
+ vim_snprintf(buf, sizeof(buf), "date > %s", file);
system(buf);
dfd = fopen(file, "a");
} else {
@@ -717,13 +724,13 @@ void workshop_connect(XtAppContext context)
}
#endif
- sprintf(buf, NOCATGETS("connected %s %s %s\n"),
+ vim_snprintf(buf, sizeof(buf), NOCATGETS("connected %s %s %s\n"),
workshop_get_editor_name(),
PROTOCOL_VERSION,
workshop_get_editor_version());
write(sd, buf, strlen(buf));
- sprintf(buf, NOCATGETS("ack 1\n"));
+ vim_snprintf(buf, sizeof(buf), NOCATGETS("ack 1\n"));
write(sd, buf, strlen(buf));
}
@@ -1047,21 +1054,24 @@ void workshop_set_option_first(char *name, char *value)
void workshop_file_closed(char *filename)
{
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("deletedFile %s\n"), filename);
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("deletedFile %s\n"), filename);
write(sd, buffer, strlen(buffer));
}
void workshop_file_closed_lineno(char *filename, int lineno)
{
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("deletedFile %s %d\n"), filename, lineno);
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("deletedFile %s %d\n"), filename, lineno);
write(sd, buffer, strlen(buffer));
}
void workshop_file_opened(char *filename, int readOnly)
{
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("loadedFile %s %d\n"), filename, readOnly);
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("loadedFile %s %d\n"), filename, readOnly);
write(sd, buffer, strlen(buffer));
}
@@ -1069,7 +1079,8 @@ void workshop_file_opened(char *filename, int readOnly)
void workshop_file_saved(char *filename)
{
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("savedFile %s\n"), filename);
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("savedFile %s\n"), filename);
write(sd, buffer, strlen(buffer));
/* Let editor report any moved marks that the eserve client
@@ -1080,14 +1091,16 @@ void workshop_file_saved(char *filename)
void workshop_move_mark(char *filename, int markId, int newLineno)
{
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("moveMark %s %d %d\n"), filename, markId, newLineno);
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("moveMark %s %d %d\n"), filename, markId, newLineno);
write(sd, buffer, strlen(buffer));
}
void workshop_file_modified(char *filename)
{
char buffer[2*MAXPATHLEN];
- sprintf(buffer, NOCATGETS("modifiedFile %s\n"), filename);
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("modifiedFile %s\n"), filename);
write(sd, buffer, strlen(buffer));
}
@@ -1097,7 +1110,8 @@ void workshop_frame_moved(int new_x, int new_y, int new_w, int new_h)
if (sd >= 0)
{
- sprintf(buffer, NOCATGETS("frameAt %d %d %d %d\n"),
+ vim_snprintf(buffer, sizeof(buffer),
+ NOCATGETS("frameAt %d %d %d %d\n"),
new_x, new_y, new_w, new_h);
write(sd, buffer, strlen(buffer));
}
@@ -1150,7 +1164,8 @@ void workshop_perform_verb(char *verb, void *clientData)
}
}
- sprintf(buf, NOCATGETS("toolVerb %s %s %d,%d %d,%d %d,%d %d %s\n"),
+ vim_snprintf(buf, sizeof(buf),
+ NOCATGETS("toolVerb %s %s %d,%d %d,%d %d,%d %d %s\n"),
verb,
filename,
curLine, curCol,