Index: kdegraphics/kdvi/dviwin.cpp
diff -u kdegraphics/kdvi/dviwin.cpp:1.77.2.3 kdegraphics/kdvi/dviwin.cpp:1.77.2.4
--- kdegraphics/kdvi/dviwin.cpp:1.77.2.3        Thu Nov  8 19:14:27 2001
+++ kdegraphics/kdvi/dviwin.cpp Sun Dec  8 00:15:00 2002
@@ -862,10 +862,10 @@
       QUrl DVI_Url(dviFile->filename);
       QUrl Link_Url(DVI_Url, hyperLinkList[i].linkText, TRUE );

-       KShellProcess proc;
-       proc << "kfmclient openURL " << Link_Url.toString();
-       proc.start(KProcess::Block);
-       //@@@ Set up a warning requester if the command failed?
+        QStringList args;
+        args << "openURL";
+        args << Link_Url.toString();
+        kapp->kdeinitExec("kfmclient", args);
      }
      break;
    }
Index: kdegraphics/kdvi/fontpool.cpp
diff -u kdegraphics/kdvi/fontpool.cpp:1.12 kdegraphics/kdvi/fontpool.cpp:1.12.2.1
--- kdegraphics/kdvi/fontpool.cpp:1.12  Mon Jun 11 15:40:16 2001
+++ kdegraphics/kdvi/fontpool.cpp       Sun Dec  8 00:15:01 2002
@@ -235,7 +235,7 @@
  proc->clearArguments();
  *proc << "kpsewhich";
  *proc << QString("--dpi %1").arg(MFResolutions[MetafontMode]);
-  *proc << QString("--mode %1").arg(MFModes[MetafontMode]);
+  *proc << QString("--mode %1").arg(KShellProcess::quote(MFModes[MetafontMode]));
  // Enable automatic pk-font generation only in the second pass, and
  // only if the user expressidly asked for it.
  if ((makepk == 0) || (pass == 0))
@@ -248,10 +248,10 @@
  while ( fontp != 0 ) {
    if ((fontp->flags & font::FONT_KPSE_NAME) == 0) {
      numFontsInJob++;
-      *proc << QString("%1.%2pk").arg(fontp->fontname).arg((int)(fontp->fsize + 0.5));
+      *proc << KShellProcess::quote(QString("%2.%1pk").arg((int)(fontp->fsize + 0.5)).arg(fontp->fontname));
      // In the first pass, we look also for virtual fonts.
      if (pass == 0)
-       *proc << QString("%1.vf").arg(fontp->fontname);
+       *proc << KShellProcess::quote(QString("%1.vf").arg(fontp->fontname));
      // In the second (last) pass, mark the font "looked up". As this
      // is the last chance that the filename could be found, we
      // ensure that if the filename is still not found now, we won't
Index: kdegraphics/kfaxview/kfax_multipage.cpp
diff -u kdegraphics/kfaxview/kfax_multipage.cpp:1.13 kdegraphics/kfaxview/kfax_multipage.cpp:1.13.2.1
--- kdegraphics/kfaxview/kfax_multipage.cpp:1.13        Thu Mar 29 21:23:42 2001
+++ kdegraphics/kfaxview/kfax_multipage.cpp     Wed Dec 11 16:41:24 2002
@@ -138,9 +138,8 @@
       {
         QString fname = KGlobal::dirs()->saveLocation("data", "kfax/faxes");
         fname += "/faxXXXXXX";
-         char buffer[256];
-         strcpy(buffer, fname.local8Bit());
-         int fd=mkstemp(buffer);
+         QCString buffer = QFile::encodeName(fname);
+         int fd=mkstemp(buffer.data());
         TIFF *tif2 = TIFFFdOpen(fd, buffer, "w");
         if (!tif2)
           {
Index: kdegraphics/kghostview/kgv_miniwidget.cpp
diff -u kdegraphics/kghostview/kgv_miniwidget.cpp:1.100.2.2 kdegraphics/kghostview/kgv_miniwidget.cpp:1.100.2.3
--- kdegraphics/kghostview/kgv_miniwidget.cpp:1.100.2.2 Thu Nov  8 01:35:51 2001
+++ kdegraphics/kghostview/kgv_miniwidget.cpp   Fri Sep 27 04:39:53 2002
@@ -529,7 +529,8 @@
           free( comment );
           continue;
       }
-       sscanf( comment + length("%%Pages:" ), "%s", text );
+       sscanf( comment + length("%%Pages:" ), "%256s", text );
+        text[256] = 0;
       if( strcmp( text, "(atend)" ) == 0 ) {
           fputs( comment, to );
           pages_atend = true;
Index: kdegraphics/kghostview/ps.c
diff -u kdegraphics/kghostview/ps.c:1.11 kdegraphics/kghostview/ps.c:1.11.2.1
--- kdegraphics/kghostview/ps.c:1.11    Fri May  4 11:37:49 2001
+++ kdegraphics/kghostview/ps.c Fri Sep 27 04:39:53 2002
@@ -226,7 +226,8 @@
           exit(-1);
       }
       memset(doc, 0, sizeof(struct document));
-       sscanf(line, "%*s %s", text);
+       sscanf(line, "%*s %256s", text);
+        text[256] = 0;
       doc->epsf = iscomment(text, "EPSF-");
       doc->beginheader = position;
       section_len = line_len;
@@ -250,7 +251,8 @@
       } else if (doc->date == NULL && iscomment(line+2, "CreationDate:")) {
           doc->date = gettextline(line+length("%%CreationDate:"));
       } else if (bb_set == NONE && iscomment(line+2, "BoundingBox:")) {
-           sscanf(line+length("%%BoundingBox:"), "%s", text);
+           sscanf(line+length("%%BoundingBox:"), "%256s", text);
+            text[256] = 0;
           if (strcmp(text, "(atend)") == 0) {
               bb_set = ATEND;
           } else {
@@ -282,7 +284,8 @@
           }
       } else if (orientation_set == NONE &&
                  iscomment(line+2, "Orientation:")) {
-           sscanf(line+length("%%Orientation:"), "%s", text);
+           sscanf(line+length("%%Orientation:"), "%256s", text);
+            text[256] = 0;
           if (strcmp(text, "(atend)") == 0) {
               orientation_set = ATEND;
           } else if (strcmp(text, "Portrait") == 0) {
@@ -299,7 +302,8 @@
               orientation_set = 1;
           }
       } else if (page_order_set == NONE && iscomment(line+2, "PageOrder:")) {
-           sscanf(line+length("%%PageOrder:"), "%s", text);
+           sscanf(line+length("%%PageOrder:"), "%256s", text);
+            text[256] = 0;
           if (strcmp(text, "(atend)") == 0) {
               page_order_set = ATEND;
           } else if (strcmp(text, "Ascend") == 0) {
@@ -313,7 +317,8 @@
               page_order_set = 1;
           }
       } else if (pages_set == NONE && iscomment(line+2, "Pages:")) {
-           sscanf(line+length("%%Pages:"), "%s", text);
+           sscanf(line+length("%%Pages:"), "%256s", text);
+            text[256] = 0;
           if (strcmp(text, "(atend)") == 0) {
               pages_set = ATEND;
           } else {
@@ -562,7 +567,8 @@
               /* Do nothing */
           } else if (doc->default_page_orientation == NONE &&
               iscomment(line+2, "PageOrientation:")) {
-               sscanf(line+length("%%PageOrientation:"), "%s", text);
+               sscanf(line+length("%%PageOrientation:"), "%256s", text);
+                text[256] = 0;
               if (strcmp(text, "Portrait") == 0) {
                   doc->default_page_orientation = PORTRAIT;
               } else if (strcmp(text, "Landscape") == 0) {
@@ -690,7 +696,8 @@
               /* Do nothing */
           } else if (doc->default_page_orientation == NONE &&
               iscomment(line+2, "PageOrientation:")) {
-               sscanf(line+length("%%PageOrientation:"), "%s", text);
+               sscanf(line+length("%%PageOrientation:"), "%256s", text);
+                text[256] = 0;
               if (strcmp(text, "Portrait") == 0) {
                   doc->default_page_orientation = PORTRAIT;
               } else if (strcmp(text, "Landscape") == 0) {
@@ -816,7 +823,8 @@
               /* Do nothing */
           } else if (doc->pages[doc->numpages].orientation == NONE &&
               iscomment(line+2, "PageOrientation:")) {
-               sscanf(line+length("%%PageOrientation:"), "%s", text);
+               sscanf(line+length("%%PageOrientation:"), "%256s", text);
+                text[256] = 0;
               if (strcmp(text, "Portrait") == 0) {
                   doc->pages[doc->numpages].orientation = PORTRAIT;
               } else if (strcmp(text, "Landscape") == 0) {
@@ -852,7 +860,8 @@
               free(cp);
           } else if ((page_bb_set == NONE || page_bb_set == ATEND) &&
                      iscomment(line+2, "PageBoundingBox:")) {
-               sscanf(line+length("%%PageBoundingBox:"), "%s", text);
+               sscanf(line+length("%%PageBoundingBox:"), "%256s", text);
+                text[256] = 0;
               if (strcmp(text, "(atend)") == 0) {
                   page_bb_set = ATEND;
               } else {
@@ -956,7 +965,8 @@
           }
       } else if (orientation_set == ATEND &&
                  iscomment(line+2, "Orientation:")) {
-           sscanf(line+length("%%Orientation:"), "%s", text);
+           sscanf(line+length("%%Orientation:"), "%256s", text);
+            text[256] = 0;
           if (strcmp(text, "Portrait") == 0) {
               doc->orientation = PORTRAIT;
           } else if (strcmp(text, "Landscape") == 0) {
@@ -967,7 +977,8 @@
               doc->orientation = SEASCAPE;
           }
       } else if (page_order_set == ATEND && iscomment(line+2, "PageOrder:")) {
-           sscanf(line+length("%%PageOrder:"), "%s", text);
+           sscanf(line+length("%%PageOrder:"), "%256s", text);
+            text[256] = 0;
           if (strcmp(text, "Ascend") == 0) {
               doc->pageorder = ASCEND;
           } else if (strcmp(text, "Descend") == 0) {
@@ -1250,9 +1261,12 @@
       *line_len += nbytes;
       strcpy(line, save);
    } else if (iscomment(line+7, "Data:")) {
+        int rc = 0;
       text[0] = '\0';
       strcpy(save, line+7);
-       if (sscanf(line+length("%%BeginData:"), "%d %*s %s", &num, text) >= 1) {
+       rc = sscanf(line+length("%%BeginData:"), "%d %*s %256s", &num, text);
+        text[256] = 0;
+        if (rc >= 1) {
           if (strcmp(text, "Lines") == 0) {
               for (i=0; i < num; i++) {
                   cp = fgets(line, size, fp);
@@ -1325,9 +1339,11 @@
       if (!(DSCcomment(line) && iscomment(line+2, "Begin"))) {
           /* Do nothing */
       } else if (iscomment(line+7, "Data:")) {
+            int rc = 0;
           text[0] = '\0';
-           if (sscanf(line+length("%%BeginData:"),
-                      "%d %*s %s", &num, text) >= 1) {
+           rc = sscanf(line+length("%%BeginData:"),"%d %*s %256s", &num, text);
+            text[256] = 0;
+            if (rc >= 1) {
               if (strcmp(text, "Lines") == 0) {
                   for (i=0; i < num; i++) {
                       fgets(line, sizeof line, from);
@@ -1405,9 +1421,11 @@
       if (!(DSCcomment(line) && iscomment(line+2, "Begin"))) {
           /* Do nothing */
       } else if (iscomment(line+7, "Data:")) {
+            int rc = 0;
           text[0] = '\0';
-           if (sscanf(line+length("%%BeginData:"),
-                      "%d %*s %s", &num, text) >= 1) {
+           rc = sscanf(line+length("%%BeginData:"),"%d %*s %256s", &num, text);
+            text[256] = 0;
+            if (rc >= 1) {
               if (strcmp(text, "Lines") == 0) {
                   for (i=0; i < num; i++) {
                       fgets(line, sizeof line, from);