Commit Graph

50 Commits

Author SHA1 Message Date
Patrick Georgi 7ab683d29a handle missing return values 2025-12-18 22:58:26 +01:00
Patrick Georgi ae001c320f fix misleading indentation
Mostly to shut up the compiler, but some real bugs hidden in there.
2025-12-18 22:58:26 +01:00
Patrick Georgi b86eff35f0 Fix memory leaks 2025-12-18 22:58:26 +01:00
hyousatsu fbc9488037 dtcreate: make pop-ups work properly. 2024-09-09 06:39:02 +00:00
Chase 9a9d586e87 configure: detect libdl 2022-07-31 18:33:49 -06:00
Peter Howkins 85684c337a dtcreate: Resolve uninitialized warnings 2021-12-24 10:50:28 -07:00
Jon Trulson d470302354 Fix several pointer-bool-conversion warnings that could cause cores 2021-12-11 17:39:35 -07:00
Jon Trulson 51646fb06a programs/: remove Imakefiles for completed modules 2021-07-03 19:12:43 -06:00
Lev Kujawski a6ea2a2d52 Centralize catgets() calls through MsgCat
CDE has relied upon catgets() implementations following a relaxed
interpretation of the XPG internationalization standard that ignored
-1, the standard error value returned by catopen, as the catalog
argument. However, this same behavior causes segmentation faults with
the musl C library.

This patch:

- Centralizes (with the exception of ToolTalk) all calls to catopen(),
  catgets(), and catclose() through MsgCat within the DtSvc library.
- Prevents calls to catgets() and catclose() that rely upon
  undefined behavior.
- Eliminates a number of bespoke catgets() wrappers, including multiple
  redundant caching implementations designed to work around a design
  peculiarity in HP/UX.
- Eases building CDE without XPG internationalization support by providing
  the appropriate macros.
2021-06-02 19:55:15 -06:00
Jon Trulson ece5c0ea14 Merge branch 'master' into autotools-conversion
Lost the ksh93 submodule so will re-add in a later commit.
2021-01-30 19:04:10 -07:00
Peter Howkins 25d34e6398 dtcreate: remove hacky solution to declaring and defining variables in .h files
Split them into .c and .h like usual.y
2020-11-26 03:16:16 +00:00
Jon Trulson 90e61dda5f Merge branch 'master' into autotools-conversion 2020-11-24 16:53:24 -07:00
Peter Howkins 30f2d925ef dtcreate: Resolve GCC 10 errors about multiple definitions of global variables 2020-11-24 02:19:05 +00:00
Jon Trulson c329d5cfd7 Remove $(TIRPCINC) from all Makefile.am files - it no longer exists
Also, restructure some of the dependencies in the lib/tt binaries.  We
will link with libtt (which will include libtirpc as a dependency),
and XTOOLLIB - all the right X11 stuff without needing to add it to
every OS.  Removed several uneeded OS specializations ("if LINUX",
etc) as a result.
2019-11-20 18:52:29 -07:00
Jon Trulson 10eb9a6975 dtcreate: make it build 2019-11-20 17:54:12 -07:00
Jon Trulson 730da7747c Change "if SUN" conditionals in remaining Makefile.am files to "if SOLARIS" 2019-10-28 18:54:17 -06:00
Chase 398de66d9f programs/dtcreate: add automake files 2019-10-23 15:34:20 -06:00
chase dd68514e4f Remove hpversion.h from repository
This patch removes hpversion.h from the repository, this also untangles a
lot of ifdef mess. This closes bug CDExc19524.
2018-10-06 17:00:38 -06:00
Peter Howkins 3baf0744f2 dtcreate: Change to ANSI function definitions 2018-06-28 04:11:21 +01:00
Ulrich Wilkens 07f272122d Fix Linux rpc problems with new glibc 2018-05-31 18:00:22 -06:00
chase 4f5e7fe5e3 Use POSIX macros for linux 2018-05-24 18:22:55 -06:00
chase 164e695cd0 remove OSF1 support 2018-05-24 14:25:26 -06:00
chase 07900bd93b Remove Unixware and openserver support 2018-05-20 12:13:07 -06:00
chase 8a4f389634 Remove UXPDS support 2018-05-15 20:27:22 -06:00
chase 1fe5a550b2 Fix typo in license headers 2018-04-28 12:30:20 -06:00
Jon Trulson 4b9bcae29f dtcreate/fileio.c: coverity CID 175094; dref bef NULL 2018-04-01 18:41:54 -06:00
Jon Trulson dbe044c24c dtcreate/CreateActionAppShell.c: coverity CID 175092; uninit ptr read 2018-04-01 18:35:14 -06:00
Peter Howkins bcccf559ce dtcreate: Resolve coverity issues 2018-03-30 23:35:39 +01:00
Cody Kotichas 1d037477f1 Fix typographical error 2017-08-09 16:52:44 -06:00
Ulrich Wilkens 01d6c363fa OpenIndiana and Solaris port 2014-10-28 13:40:11 -06:00
Peter Tribble 468d576030 initial illumos port 2014-03-22 16:33:11 -06:00
Ulrich Wilkens 2712d5f787 NetBSD port 2014-02-22 19:12:19 -07:00
Ulrich Wilkens 2d08153289 correction of message files 2013-09-15 19:35:53 -06:00
Marcin Cieslak 48b76f8623 dtcreate: Don't crash when clicking "Find Set..."
dtcreate crashed on 64-bit system when clicking
"Find Set.." button.

Crash happens in libXm:

    new_w=0x805db4300, args=0x7fffffffb430, num_args=0x7fffffffb3dc)
    at Form.c:1955

$1 = {att = {{type = 4 '\004', w = 0x805db3700, percent = 0, offset = 0,
      value = 0, tempValue = 0}, {type = 1 '\001', w = 0x0, percent = 0,
      offset = 10, value = 0, tempValue = 0}, {type = 3 '\003',
      w = 0x805db3700, percent = 0, offset = 0, value = 0, tempValue = 0}, {
      type = 3 '\003', w = 0x800000000, percent = 0, offset = 10, value = 0,
      tempValue = 0}}, next_sibling = 0x0, sorted = 0 '\0',
  resizable = 1 '\001', preferred_width = 0, preferred_height = 0}

(...)

    at icon_selection_dialog.c:1768
1767            /* Creation of icon_scrolled_win */
1768            icon_scrolled_win = XtVaCreateManagedWidget( "icon_scrolled_win",
1769                            xmScrolledWindowWidgetClass,
1770                            icon_selection_dialog,
1771                            XmNscrollingPolicy, XmAUTOMATIC,
1772    /*                      XmNnavigationType, XmTAB_GROUP, */
1773                            XmNx, 282,
1774                            XmNy, 84,
1775                            XmNscrollBarDisplayPolicy, XmAS_NEEDED,
1776                            XmNrightOffset, 10,
1777                            XmNrightAttachment, XmATTACH_FORM,
1778                            XmNtopOffset, 0,
1779                            XmNtopWidget, icon_container_label,
1780                            XmNtopAttachment, XmATTACH_WIDGET,
1781                            XmNleftOffset, 0,
1782                            XmNleftWidget, icon_container_label,
1783                            XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
1784                            XmNbottomOffset, 10,
1785                            XmNbottomWidget, XmATTACH_NONE,
1786                            XmNbottomAttachment, XmATTACH_WIDGET,
1787                            NULL );

What happens here is that ConstraintInitialize receives
four constraints, the last one is this:

    { type = 3 '\003', /* XmATTACH_WIDGET */
      w = 0x800000000, /* malformed XmATTACH_NONE ???
      percent = 0,
      offset = 10, /* specified as XmNbottomOffset */
      value = 0,
      tempValue = 0}

XmATTACH_* values are defined in <Xm/Xm.h> as follows:

   505  enum{   XmATTACH_NONE,                  XmATTACH_FORM,
   506          XmATTACH_OPPOSITE_FORM,         XmATTACH_WIDGET,
   507          XmATTACH_OPPOSITE_WIDGET,       XmATTACH_POSITION,
   508          XmATTACH_SELF
   509          } ;

What is not clear to why XmATTACH_NONE - which should be (int)0 -
becomes 0x800000000 - looks like a 64 bit bug somewhere.

Providing a long value on None (0L) as in this change fixes the
problem.

I understand is that it possible to use such an "empty" widget
is to create additional space at the bottom of the newly created
"icon_scrolled_win".

What needs to be clarified - shouldn't be such an (int) value be
automatically promoted to (long) (or XtArgVal, XtPointer, ...)
and preserve the value 0? Lots of parameters seem to be
passed as ints (for example dimensions) and they do not
appear to cause any trouble.
2012-09-30 11:11:21 -06:00
Marcin Cieslak 27bc7d6bec dtcreate: Add missing prototypes and more (64-bit)
- Fix missing prototypes
- Fix some 64-bit related problems (XtVaGetValues)
- Fix crash on dtcreate startup in create_applicationShell1()
- Add XmeFlushIconFileCache() prototype from <Xm/IconFileP.h>
2012-09-29 20:28:45 -06:00
Frederic Koehler 71962e580d dtcreate: Avoid trying to reuse closed help window
This fixes a segfault when trying to go to help a second
time, after closing the first window.
2012-09-29 19:29:02 -06:00
Jon Trulson a29fc20957 message catalogs: fix comment lines, also remove linux hack in merge.c
According to the spec, blank lines in message catalogs or lines
beginning with '$ ' are valid comments.

However, there were many cases where lines in the message catalogs
contained just a single '$', without the required space after it.

Under linux, this caused 126766 error lines (in my builds) of the
form:

... unknown directive `': line ignored

This also causes gencat to exit with a non-0 exit code.  Even though
gencat says it ignores the line, it really doesn't.

An early porting change to programs/localized/util/merge.c was made to
ignore this return value on linux.  This hack has now been removed.

Build logs are a lot smaller and cleaner now.
2012-09-03 15:12:57 -06:00
Peter Howkins ce7f5d0862 dtcreate: warning prevention. 2012-08-30 18:07:16 +01:00
Frederic Koehler f5ac4cf8f9 dtcreate: Replace broken GetBaseName with basename
GetBaseName causes segfaults, because when the pathname
ends in a "/" it returns NULL. This happens when trying
to give a valid filename to dtcreate for an icon.
2012-08-17 19:04:13 -06:00
Frederic Koehler 7d2fee2769 dtcreate: Fix some memory management issues
ProcessExecString thought it was returning an array of size 3; however
in C arrays are second-class and there is no direct way to return an
array like this; GCC warning triggered because it was actually
just returning a pointer to local storage. Fixed using malloc.

Also fix some obviously wrong usages of sizeof, although they were
relatively harmless. A little other warning quieting using 0 instead of
NULL.
2012-08-17 19:03:01 -06:00
Frederic Koehler c8a5b9671f dtcreate: Fix another buffer overflow issue 2012-08-17 19:02:55 -06:00
Frederic Koehler 466191d669 dtcreate: Fix major buffer overflow
This code always buffer overflowed, because exactly 2 bytes
less than were used were allocated. This led to dtcreate
crashing when hitting "Find Set..."
2012-08-16 19:25:22 -06:00
William Schaub 7153a0e3e2 dtcreate: check for TT_ERR_PTYPE the correct way 2012-08-12 14:34:49 -06:00
William Schaub b17e52a269 dtcreate: Fix double free inside ProcessExecString() 2012-08-11 19:33:22 -06:00
William Schaub 562da5af1b dtcreate: fix exit with TT_ERR_PTYPE and fix several sprintf related segfaults. 2012-08-11 19:32:48 -06:00
Jon Trulson cdf8003f7c Remove hardcoded CCLINK's in Imakefiles when linking with C++ built libs (DtSvc).
Added proper SharedDtSvcReqs in lnxLib.tmpl and CplusplusLibC in
linux.cf.  This allows the libstdc++ dependancy to be properly
declared for libDtSvc so that it is not neccessary to hardcode 'CCLINK
= g++' in the Imakefiles of programs linking angainst libDtSvc.
2012-06-19 16:27:20 -06:00
Peter Howkins a34f78b798 convert all Imakefile LinuxDistribution to LinuxArchitecture.
(programs part 2)
2012-05-31 13:47:41 +01:00
Peter Howkins 7d5fcc4400 Link with C++ linker 2012-03-12 11:16:41 +00:00
Peter Howkins c884521619 Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Peter Howkins 83b6996daa Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00