Hi,
I'm in the process of packaging CDE for opensuse.
While doing that I have found some issues and I have some doubts
that I would like to share with you.

1) CDE does not compile with gcc12. In many places it throws the error:
  error: control reaches end of non-void function [-Werror=return-type]
Attached there is a patch that makes CDE 2.5.1 compile with gcc12.
Please use such patch only as reference to see which functions
have problems. Do not consider the patch correct C code.
I just put some return statements here and there assuming
that whatever value was returned it would be ignored.
The purpose was only to have the build process proceed without errors
in order to find all the troubling functions.
While now urgent, this task needs to be done at some point.


2) If CDE is build with --prefix=/ust/dt (the default),
many binaries have rpath set. Since that is forbidden
by opensuse packaging rules, I'm forced to use the command
chrpath on such binaries.
configure has the option '--disable-rpath' but it does not seems to
work. Using such options or not does not make any difference.
Perhaps some Makefile.am needs adjust?


3) I have seen that in 2.5.1 only dtappgather is setuid.
In the past the list was bigger. Is that correct?
Is there any possibility that in the future no setuid
program will be necessary?


4) When I run dtbuilder, if I click on any widget in the main
window the program crashes showing the following error messages:

X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  53 (X_CreatePixmap)
  Serial number of failed request:  14181
  Current serial number in output stream:  14184


5) Since 2.5.0 if I start from a terminal some CDE programs
(dtterm, dtpad, dtinfo, etc.) the following warning appears:
  Warning: Missing charset in String to FontSet conversion
  Warning: Missing charset in String to FontSet conversion
That didn't happens in CDE up to 2.4.0


6) In the file contrib/desktopentry/cde.desktop
it would be a good idea to add the line:
  DesktopNames=CDE
In this way, after a login, the desktop manager will set the environment 
variables:
XDG_CURRENT_DESKTOP and XDG_SESSION_DESKTOP


7) In the file programs/types/pgadmin.dt the line:
     ICON          pgadmin
should be:
     ICON          pgadmin3


8) /usr/dt/bin/dterror.ds does not work properly in CDE 2.5.x
It is build using programs/dtfile/dterror.src as source,
but is should be using programs/types/error.ds.src as source.
See databases/CDE-RUN.src in CDE up to 2.4.0


9) the command: 
  ksh -c 'echo "\n"'
prints a new line as output. So did the command: 
  dtksh -c 'echo "\n"'
in CDE up to 2.3.2.
Since 2.4.0 instead the same dtksh command prints: \n
To restore the correct behavior ECHOPRINT=1 must be set
in programs/dtksh/ksh93/src/cmd/ksh93/SHOPT.sh


10) If, for example, I execure the action: 
ApplicationManager/Desktop_Tools/Environment Variables,
in the output window I see at the end:
------------
\n*** Select Close or Exit from the window menu to close this window ***
------------
instead of:
------------

*** Select Close or Exit from the window menu to close this window ***
------------
The problem seems to be that many dtactions use: sh -c '...; echo ...\n...'
in order to print a new line. Since, on linux, generally sh is bash, echo -e 
'\n'
is required to print the new line. On a system where sh is a different shell
(zsh, ksh, dash) echo will work as expected.
My workaround for linux is to replace: 'sh -c' with: 'ksh -c'
For that purpose I use the following command:
  sed -i 's@\([[:blank:]]\)\(sh -c\)@\1k\2@' programs/types/*.{dt,src}
I guess such change should work for any architecture.


11) the session is not saved correctly for dtterm, dtpad and dticon.
In CDE 2.5; If you open dtterm or dtpad and logout, on the next login
such windows are not restored.
In the files programs/dticon/utils.c, programs/dtpad/session.c and
programs/dtterm/DtTermMain.c there is code like this:
  sprintf(buf, "%s some further text", buf)
The C99 and POSIX.1-2001 standard specify that the result is undefined,
I think that since the introduction of the definition:
  #define _XOPEN_SOURCE 600
the sprintf code is not working anymore.
I'm attaching a patch that makes the saving of the session
work again. It is not elegant code, but it can be used
as a reference about what needs to be done.


That's all for the moment.
Giacomo
diff -Nraub cde-2.5.1.ori/lib/DtHelp/FormatSDL.c 
cde-2.5.1/lib/DtHelp/FormatSDL.c
--- cde-2.5.1.ori/lib/DtHelp/FormatSDL.c        2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/lib/DtHelp/FormatSDL.c    2023-01-25 00:54:26.638816531 -0400
@@ -4367,6 +4367,7 @@
  */
 static void *strmove(void *dest, const void *src) {
     memmove(dest, src, strlen(src) + 1);
+    return(0);
 }
 
 /******************************************************************************
@@ -8757,6 +8758,7 @@
        segments = _DtCvNextSeg(segments);
       }
 
+    return(0);
 } /* End SetGhostLink */
 
 /******************************************************************************
diff -Nraub cde-2.5.1.ori/lib/DtHelp/Graphics.c cde-2.5.1/lib/DtHelp/Graphics.c
--- cde-2.5.1.ori/lib/DtHelp/Graphics.c 2022-10-01 13:18:27.000000000 -0400
+++ cde-2.5.1/lib/DtHelp/Graphics.c     2023-01-25 00:54:26.638816531 -0400
@@ -2916,6 +2916,7 @@
                 return (num_items);
         }
     }
+    return(0);
 }
 
 /******************************************************************************
@@ -2969,6 +2970,7 @@
         else
             return(-1); /* Failure */
     }
+    return(0);
 }
 
 /******************************************************************************
@@ -2997,6 +2999,7 @@
         else
            return ((unsigned char) *(stream->source.buffer.current++));
     }
+    return(0);
 }
 
 /******************************************************************************
@@ -3058,4 +3061,5 @@
         *buffer = '\0';
         return (save);
     }
+    return(0);
 }
diff -Nraub cde-2.5.1.ori/lib/DtHelp/Selection.c 
cde-2.5.1/lib/DtHelp/Selection.c
--- cde-2.5.1.ori/lib/DtHelp/Selection.c        2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/lib/DtHelp/Selection.c    2023-01-25 00:54:26.638816531 -0400
@@ -392,6 +392,7 @@
        *pt2 = *pt1;
        *pt1 = temp;
       }
+    return(0);
 }
 
 /*****************************************************************************
diff -Nraub cde-2.5.1.ori/lib/DtHelp/il/ilpipe.c 
cde-2.5.1/lib/DtHelp/il/ilpipe.c
--- cde-2.5.1.ori/lib/DtHelp/il/ilpipe.c        2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/lib/DtHelp/il/ilpipe.c    2023-01-25 00:54:26.638816531 -0400
@@ -1364,6 +1364,7 @@
 
             }   /* END while true: execute strips */
         }       /* END switch pipe state */
+    return(0);
 }
 
 
diff -Nraub cde-2.5.1.ori/lib/DtSearch/dtsrjoint.c 
cde-2.5.1/lib/DtSearch/dtsrjoint.c
--- cde-2.5.1.ori/lib/DtSearch/dtsrjoint.c      2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/lib/DtSearch/dtsrjoint.c  2023-01-25 00:54:26.638816531 -0400
@@ -584,6 +584,7 @@
                ditsort_type);
            DtSearchExit (32);
     }
+    return(0);
 }  /* ditto_sort() */
 
 
diff -Nraub cde-2.5.1.ori/lib/DtSvc/DtUtil1/ActionTt.c 
cde-2.5.1/lib/DtSvc/DtUtil1/ActionTt.c
--- cde-2.5.1.ori/lib/DtSvc/DtUtil1/ActionTt.c  2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/lib/DtSvc/DtUtil1/ActionTt.c      2023-01-25 00:54:26.638816531 
-0400
@@ -856,6 +856,7 @@
        return( DtACT_TT_REP_INT);
     else if (status == TT_ERR_NUM)
        return( DtACT_TT_REP_BUFFER );
+    return(0);
 }
 
 /******************************************************************************
diff -Nraub cde-2.5.1.ori/lib/csa/match.c cde-2.5.1/lib/csa/match.c
--- cde-2.5.1.ori/lib/csa/match.c       2022-10-01 13:18:27.000000000 -0400
+++ cde-2.5.1/lib/csa/match.c   2023-01-25 00:54:26.638816531 -0400
@@ -1049,6 +1049,7 @@
        defalut:
                return (B_FALSE);
        }
+       return(0);
 }
 
 static Attribute_4 *
diff -Nraub cde-2.5.1.ori/programs/dtappbuilder/src/abmf/resource_file.c 
cde-2.5.1/programs/dtappbuilder/src/abmf/resource_file.c
--- cde-2.5.1.ori/programs/dtappbuilder/src/abmf/resource_file.c        
2022-10-01 13:18:27.000000000 -0400
+++ cde-2.5.1/programs/dtappbuilder/src/abmf/resource_file.c    2023-01-25 
00:54:26.638816531 -0400
@@ -454,6 +454,8 @@
     else if (userSegOff >= 0)
 
     return userSegOff;
+
+    return(0);
 }
 
 
diff -Nraub cde-2.5.1.ori/programs/dtcm/server/cmscalendar.c 
cde-2.5.1/programs/dtcm/server/cmscalendar.c
--- cde-2.5.1.ori/programs/dtcm/server/cmscalendar.c    2022-10-01 
13:18:27.000000000 -0400
+++ cde-2.5.1/programs/dtcm/server/cmscalendar.c        2023-01-25 
00:54:26.638816531 -0400
@@ -611,6 +611,7 @@
        case rb_other:
                return (CSA_E_FAILURE);
        }
+       return (CSA_SUCCESS);
 }
 
 extern void
diff -Nraub cde-2.5.1.ori/programs/dtcreate/FileCharacteristics.c 
cde-2.5.1/programs/dtcreate/FileCharacteristics.c
--- cde-2.5.1.ori/programs/dtcreate/FileCharacteristics.c       2022-10-01 
13:18:27.000000000 -0400
+++ cde-2.5.1/programs/dtcreate/FileCharacteristics.c   2023-01-25 
00:54:26.638816531 -0400
@@ -173,6 +173,7 @@
     return((ushort)CA_FT_CNTLONG);
   }
   /* NOTREACHED */
+  return(0);
 }
 
 
/******************************************************************************/
diff -Nraub cde-2.5.1.ori/programs/dtdocbook/instant/tables.c 
cde-2.5.1/programs/dtdocbook/instant/tables.c
--- cde-2.5.1.ori/programs/dtdocbook/instant/tables.c   2022-10-01 
13:18:27.000000000 -0400
+++ cde-2.5.1/programs/dtdocbook/instant/tables.c       2023-01-25 
00:55:48.044240590 -0400
@@ -1303,6 +1303,7 @@
        case Char:      return 'd';
        case Span:      return 's';
        }
+       return(0);
 }
 
 /*     TblGetWidth()  --  get width spec, if any, for a entry
diff -Nraub cde-2.5.1.ori/programs/dtfile/OverWrite.c 
cde-2.5.1/programs/dtfile/OverWrite.c
--- cde-2.5.1.ori/programs/dtfile/OverWrite.c   2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/programs/dtfile/OverWrite.c       2023-01-25 00:54:26.638816531 
-0400
@@ -2160,6 +2160,7 @@
 
    }  /* end switch (message) */
 
+   return(0);
 }  /* end getVariableMessage */
 
 static Boolean
diff -Nraub cde-2.5.1.ori/programs/dticon/image.c 
cde-2.5.1/programs/dticon/image.c
--- cde-2.5.1.ori/programs/dticon/image.c       2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/programs/dticon/image.c   2023-01-25 00:54:26.642816404 -0400
@@ -555,4 +555,5 @@
         l = x;
     } while (x<=x2);
   }
+  return(0);
 }
diff -Nraub cde-2.5.1.ori/programs/dtksh/dtkcmds.c 
cde-2.5.1/programs/dtksh/dtkcmds.c
--- cde-2.5.1.ori/programs/dtksh/dtkcmds.c      2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/programs/dtksh/dtkcmds.c  2023-01-25 00:54:26.642816404 -0400
@@ -2389,6 +2389,7 @@
 
 {
    invalidFont = True;
+   return(0);
 }
 
 static int
@@ -2962,6 +2963,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(DRAW_ARC, argc, argv);
+   return(0);
 }
 
 int
@@ -2970,6 +2972,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(DRAW_IMAGE_STRING, argc, argv);
+   return(0);
 }
 
 int
@@ -2978,6 +2981,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(DRAW_LINE, argc, argv);
+   return(0);
 }
 
 int
@@ -2986,6 +2990,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(DRAW_LINES, argc, argv);
+   return(0);
 }
 
 int
@@ -2994,6 +2999,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(DRAW_POINT, argc, argv);
+   return(0);
 }
 
 int
@@ -3002,6 +3008,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(DRAW_POINTS, argc, argv);
+   return(0);
 }
 
 int
@@ -3010,6 +3017,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(DRAW_RECTANGLE, argc, argv);
+   return(0);
 }
 
 int
@@ -3029,6 +3037,7 @@
    }
 
    invokeXDrawFunction(COPY_AREA, argc, argv);
+   return(0);
 }
 
 int
@@ -3037,6 +3046,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(DRAW_SEGMENTS, argc, argv);
+   return(0);
 }
 
 int
@@ -3045,6 +3055,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(DRAW_STRING, argc, argv);
+   return(0);
 }
 
 int
@@ -3053,6 +3064,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(FILL_ARC, argc, argv);
+   return(0);
 }
 
 int
@@ -3061,6 +3073,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(FILL_POLYGON, argc, argv);
+   return(0);
 }
 
 int
@@ -3069,6 +3082,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(FILL_RECTANGLE, argc, argv);
+   return(0);
 }
 
 int
@@ -3077,6 +3091,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(CLEAR_AREA, argc, argv);
+   return(0);
 }
 
 int
@@ -3085,6 +3100,7 @@
         char *argv[] )
 {
    invokeXDrawFunction(CLEAR_WINDOW, argc, argv);
+   return(0);
 }
 
 int
diff -Nraub cde-2.5.1.ori/programs/dtksh/xmcmds.c 
cde-2.5.1/programs/dtksh/xmcmds.c
--- cde-2.5.1.ori/programs/dtksh/xmcmds.c       2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/programs/dtksh/xmcmds.c   2023-01-25 00:54:26.642816404 -0400
@@ -2568,6 +2568,7 @@
         Display *display,
         XEvent *event )
 {
+       return(0);
 }
 
 
diff -Nraub cde-2.5.1.ori/programs/dtlogin/socket.c 
cde-2.5.1/programs/dtlogin/socket.c
--- cde-2.5.1.ori/programs/dtlogin/socket.c     2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/programs/dtlogin/socket.c 2023-01-25 00:54:26.642816404 -0400
@@ -156,6 +156,7 @@
     if (chooserFd > WellKnownSocketsMax)
        WellKnownSocketsMax = chooserFd;
     FD_SET (chooserFd, &WellKnownSocketsMask);
+    return(0);
 }
 
 int
diff -Nraub cde-2.5.1.ori/programs/dtpad/main.c cde-2.5.1/programs/dtpad/main.c
--- cde-2.5.1.ori/programs/dtpad/main.c 2022-10-01 13:18:27.000000000 -0400
+++ cde-2.5.1/programs/dtpad/main.c     2023-01-25 00:54:26.642816404 -0400
@@ -1739,6 +1739,7 @@
     value = tt_message_arg_val(m, 1);
     waitCB = 0;
   }
+  return(0);
 }
 
 /************************************************************************
diff -Nraub cde-2.5.1.ori/programs/dtpdm/PdmOid.c 
cde-2.5.1/programs/dtpdm/PdmOid.c
--- cde-2.5.1.ori/programs/dtpdm/PdmOid.c       2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/programs/dtpdm/PdmOid.c   2023-01-25 00:54:26.642816404 -0400
@@ -1662,6 +1662,7 @@
        return NOTIFY_EMAIL_STR;
        break;
     }
+    return(0);
 }
 
 /*
diff -Nraub cde-2.5.1.ori/programs/dtprintinfo/libUI/MotifUI/Debug.c 
cde-2.5.1/programs/dtprintinfo/libUI/MotifUI/Debug.c
--- cde-2.5.1.ori/programs/dtprintinfo/libUI/MotifUI/Debug.c    2022-10-01 
13:18:27.000000000 -0400
+++ cde-2.5.1/programs/dtprintinfo/libUI/MotifUI/Debug.c        2023-01-25 
00:54:26.642816404 -0400
@@ -71,6 +71,7 @@
         kill(getpid(), SIGQUIT);
     else
         exit(1);
+    return(0);
 }
 
 /*
@@ -94,6 +95,7 @@
         kill(getpid(), SIGQUIT);
     else
         exit(1);
+    return(0);
 }
 
 /*
diff -Nraub cde-2.5.1.ori/programs/dtprintinfo/libUI/MotifUI/Icon.c 
cde-2.5.1/programs/dtprintinfo/libUI/MotifUI/Icon.c
--- cde-2.5.1.ori/programs/dtprintinfo/libUI/MotifUI/Icon.c     2022-10-01 
13:18:27.000000000 -0400
+++ cde-2.5.1/programs/dtprintinfo/libUI/MotifUI/Icon.c 2023-01-25 
00:54:26.642816404 -0400
@@ -2049,6 +2049,7 @@
        desired->width = 1;
     if (desired->height == 0)
        desired->height = 1;
+    return(0);
 }
 
 /*
diff -Nraub cde-2.5.1.ori/programs/dtstyle/ColorEdit.c 
cde-2.5.1/programs/dtstyle/ColorEdit.c
--- cde-2.5.1.ori/programs/dtstyle/ColorEdit.c  2022-10-01 13:18:27.000000000 
-0400
+++ cde-2.5.1/programs/dtstyle/ColorEdit.c      2023-01-25 00:54:26.646816277 
-0400
@@ -1411,6 +1411,7 @@
 
    if(z >= y && z >= x)
       return(z);
+   return(0);
 }
 
 /************************************************************************
@@ -1431,6 +1432,7 @@
 
    if(z <= y && z <= x)
       return(z);
+   return(0);
 }
 
 /************************************************************************
diff -Nraub cde-2.5.1.ori/programs/dticon/utils.c 
cde-2.5.1/programs/dticon/utils.c
--- cde-2.5.1.ori/programs/dticon/utils.c       2023-02-12 18:32:03.066384010 
-0400
+++ cde-2.5.1/programs/dticon/utils.c   2023-02-13 20:57:25.238162796 -0400
@@ -2321,6 +2321,7 @@
         sprintf(bufr, "*iconic: True\n");
     else
         sprintf(bufr, "*iconic: False\n");
+    write (fd, bufr, strlen(bufr));
 
     /*** Get and write out the geometry info for our Window ***/
 
@@ -2337,12 +2338,18 @@
     x -= vendorExt->vendor.xOffset;
     y -= vendorExt->vendor.yOffset;
 
-    snprintf(bufr, sizeof(bufr), "%s*x: %d\n", bufr, x);
-    snprintf(bufr, sizeof(bufr), "%s*y: %d\n", bufr, y);
-    snprintf(bufr, sizeof(bufr), "%s*width: %d\n", bufr, width);
-    snprintf(bufr, sizeof(bufr), "%s*height: %d\n", bufr, height);
+    snprintf(bufr, sizeof(bufr), "*x: %d\n", x);
+    write (fd, bufr, strlen(bufr));
+    snprintf(bufr, sizeof(bufr), "*y: %d\n", y);
+    write (fd, bufr, strlen(bufr));
+    snprintf(bufr, sizeof(bufr), "*width: %d\n", width);
+    write (fd, bufr, strlen(bufr));
+    snprintf(bufr, sizeof(bufr), "*height: %d\n", height);
     if (last_fname[0] != '\0')
-        snprintf(bufr, sizeof(bufr), "%s*file: %s\n", bufr, last_fname);
+    {
+        write (fd, bufr, strlen(bufr));
+        snprintf(bufr, sizeof(bufr), "*file: %s\n", last_fname);
+    }
 
     if(-1 == write (fd, bufr, strlen(bufr))) {
        fprintf(stderr, "write() to session failed\n");
diff -Nraub cde-2.5.1.ori/programs/dtpad/session.c 
cde-2.5.1/programs/dtpad/session.c
--- cde-2.5.1.ori/programs/dtpad/session.c      2023-02-12 18:32:03.106384098 
-0400
+++ cde-2.5.1/programs/dtpad/session.c  2023-02-13 20:40:16.240998104 -0400
@@ -113,7 +113,10 @@
         XmWidgetExtData        extData;
 
         if(XtIsRealized(pPad->mainWindow))
+        {
            sprintf(bufr,"*mainWindow%d.ismapped: True\n", padNum);
+           write (fd, bufr, strlen(bufr));
+        }
 
         /* Get and write out the geometry info for our Window */
         x = XtX(XtParent(pPad->mainWindow));
@@ -131,10 +134,14 @@
        width = XtWidth(XtParent(pPad->mainWindow));
        height = XtHeight(XtParent(pPad->mainWindow));
 
-        snprintf(bufr, sizeof(bufr), "%s*mainWindow%d.x: %d\n", bufr, padNum, 
x);
-        snprintf(bufr, sizeof(bufr), "%s*mainWindow%d.y: %d\n", bufr, padNum, 
y);
-        snprintf(bufr, sizeof(bufr), "%s*mainWindow%d.width: %d\n", bufr, 
padNum, width);
-        snprintf(bufr, sizeof(bufr), "%s*mainWindow%d.height: %d\n", bufr, 
padNum, height);
+        snprintf(bufr, sizeof(bufr), "*mainWindow%d.x: %d\n", padNum, x);
+        write (fd, bufr, strlen(bufr));
+        snprintf(bufr, sizeof(bufr), "*mainWindow%d.y: %d\n", padNum, y);
+        write (fd, bufr, strlen(bufr));
+        snprintf(bufr, sizeof(bufr), "*mainWindow%d.width: %d\n", padNum, 
width);
+        write (fd, bufr, strlen(bufr));
+        snprintf(bufr, sizeof(bufr), "*mainWindow%d.height: %d\n", padNum, 
height);
+        write (fd, bufr, strlen(bufr));
 
         wm_state_atom = XmInternAtom (XtDisplay(pPad->app_shell), "WM_STATE", 
                                       False);
@@ -146,27 +153,32 @@
                             &nitems, &leftover, (unsigned char **) &wm_state);
 
         /* Write out if iconified our not */
-        snprintf(bufr, sizeof(bufr), "%s*mainWindow%d.iconify: ", bufr, 
padNum);
+        snprintf(bufr, sizeof(bufr), "*mainWindow%d.iconify: ", padNum);
+        write (fd, bufr, strlen(bufr));
 
         if (wm_state->state == IconicState)
-          snprintf(bufr, sizeof(bufr), "%sTrue\n", bufr);
+          snprintf(bufr, sizeof(bufr), "True\n");
         else
-          snprintf(bufr, sizeof(bufr), "%sFalse\n", bufr);
+          snprintf(bufr, sizeof(bufr), "False\n");
+        write (fd, bufr, strlen(bufr));
 
        if(DtWsmGetWorkspacesOccupied(XtDisplay(pPad->app_shell), 
                                  XtWindow(pPad->app_shell), &pWsPresence,
                                  &numInfo) == Success)
        {
            int i;
-           snprintf(bufr, sizeof(bufr), "%s*mainWindow%d.workspaceList: ", 
bufr, padNum);
+           snprintf(bufr, sizeof(bufr), "*mainWindow%d.workspaceList: ", 
padNum);
+           write (fd, bufr, strlen(bufr));
            for(i = 0; i < numInfo; i++)
            {
                char *name =  XGetAtomName(XtDisplay(pPad->app_shell),
                                           pWsPresence[i]);
-               snprintf(bufr, sizeof(bufr), "%s %s", bufr, name);
+               snprintf(bufr, sizeof(bufr), " %s", name);
+               write (fd, bufr, strlen(bufr));
                XtFree(name);
            }
-           snprintf(bufr, sizeof(bufr), "%s\n", bufr);
+           snprintf(bufr, sizeof(bufr), "\n");
+           write (fd, bufr, strlen(bufr));
            XtFree((char *)pWsPresence);
        }
 
diff -Nraub cde-2.5.1.ori/programs/dtterm/DtTermMain.c 
cde-2.5.1/programs/dtterm/DtTermMain.c
--- cde-2.5.1.ori/programs/dtterm/DtTermMain.c  2023-02-12 18:32:03.086384054 
-0400
+++ cde-2.5.1/programs/dtterm/DtTermMain.c      2023-02-13 19:22:05.844003671 
-0400
@@ -1583,9 +1583,13 @@
     height = XtHeight(XtParent(dtvw));
 
     sprintf(bufr, "*dtterm_%d.x: %d\n", cloneNum, x);
-    sprintf(bufr, "%s*dtterm_%d.y: %d\n", bufr, cloneNum, y);
-    sprintf(bufr, "%s*dtterm_%d.width: %d\n", bufr, cloneNum, width);
-    sprintf(bufr, "%s*dtterm_%d.height: %d\n", bufr, cloneNum, height);
+    write (fd, bufr, strlen(bufr));
+    sprintf(bufr, "*dtterm_%d.y: %d\n", cloneNum, y);
+    write (fd, bufr, strlen(bufr));
+    sprintf(bufr, "*dtterm_%d.width: %d\n", cloneNum, width);
+    write (fd, bufr, strlen(bufr));
+    sprintf(bufr, "*dtterm_%d.height: %d\n", cloneNum, height);
+    write (fd, bufr, strlen(bufr));
 
     /* Write out iconic state...
      */
@@ -1607,12 +1611,11 @@
            &bytesAfter,
            (unsigned char **) &prop))) {
        if (prop->state == IconicState) {
-           sprintf(bufr, "%s*dtterm_%d.iconify: %s\n", bufr, cloneNum,
-                   "True");
+           sprintf(bufr, "*dtterm_%d.iconify: %s\n", cloneNum, "True");
        } else {
-           sprintf(bufr, "%s*dtterm_%d.iconify: %s\n", bufr, cloneNum,
-                   "False");
+           sprintf(bufr, "*dtterm_%d.iconify: %s\n", cloneNum, "False");
        }
+       write (fd, bufr, strlen(bufr));
     }
        
     if(DtWsmGetWorkspacesOccupied(XtDisplay(dtvw), 
@@ -1620,20 +1623,21 @@
                                  &numInfo) == Success)
     {
        int i;
-       sprintf(bufr, "%s*dtterm_%d.workspaceList: ", bufr, cloneNum);
+       sprintf(bufr, "*dtterm_%d.workspaceList: ", cloneNum);
+       write (fd, bufr, strlen(bufr));
        for(i = 0; i < numInfo; i++)
        {
            char *name =  XGetAtomName(XtDisplay(dtvw),
                                       pWsPresence[i]);
-           sprintf(bufr, "%s %s", bufr, name);
+           sprintf(bufr, " %s", name);
+           write (fd, bufr, strlen(bufr));
            XtFree(name);
        }
-       sprintf(bufr, "%s\n", bufr);
+       sprintf(bufr, "\n");
+       write (fd, bufr, strlen(bufr));
        XtFree((char *)pWsPresence);
     }
 
-    write (fd, bufr, strlen(bufr));
-
     sprintf(bufr, "*dtterm_%d.userFontListIndex: %d\n", cloneNum,
            _DtTermViewGetUserFontListIndex((Widget )dtvw));
     write (fd, bufr, strlen(bufr));
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to