summaryrefslogtreecommitdiff
path: root/src/PSEditModel.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2005-02-28 16:56:51 +0000
committerJohannes Hofmann <johannes.hofmann@gmx.de>2005-02-28 16:56:51 +0000
commit886a904459e87f46f3f43df434307a294f85e52d (patch)
treec1df20d21a95886b9f56d90bebda01d887fa1f3b /src/PSEditModel.cxx
parent8ec55e2a75d5eb3c7305c8cadb94681df703167b (diff)
implement pdf export / import
implement pdf export / import
Diffstat (limited to 'src/PSEditModel.cxx')
-rw-r--r--src/PSEditModel.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/PSEditModel.cxx b/src/PSEditModel.cxx
index 5eeee9c..8792414 100644
--- a/src/PSEditModel.cxx
+++ b/src/PSEditModel.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: PSEditModel.cxx,v 1.12 2004/11/10 18:32:59 hofmann Exp $"
+// "$Id: PSEditModel.cxx,v 1.13 2005/02/28 17:56:51 hofmann Exp $"
//
// PSEditWidget routines.
//
@@ -108,8 +108,6 @@ int PSEditModel::set_cur_text(int x1, int y1, int p) {
}
int PSEditModel::next_text(int p) {
- PSEditText *t;
-
if (p < 0 || p >= max_pages) {
return 1;
}
@@ -239,12 +237,12 @@ PSEditText *PSEditModel::get_text(int p) {
int PSEditModel::load(FILE *fp) {
char tmpname[256];
char linebuf[1024];
- int ret;
+ ssize_t ret;
PSParser *p1 = new PSParser_1(this);
PSParser *p2 = new PSParser_2(this);
int tmp_fd;
- strncpy(tmpname, "/tmp/PSEditorXXXXXX", 256);
+ strncpy(tmpname, "/tmp/PSEditorXXXXXX", sizeof(tmpname));
tmp_fd = mkstemp(tmpname);
if (tmp_fd < 0) {
fprintf(stderr, "Could not create temporary file (errno %d).\n", errno);
@@ -254,7 +252,7 @@ int PSEditModel::load(FILE *fp) {
clear();
- while (fgets(linebuf, 1024, fp) != NULL) {
+ while (fgets(linebuf, sizeof(linebuf), fp) != NULL) {
if (!p2->parse(linebuf) && !p1->parse(linebuf)) {
ret = write(tmp_fd, linebuf, strlen(linebuf));
if (ret != strlen(linebuf)) {