Skip to content

nxcomp/src/Loop.cpp: Support NXTransDialog caption / title being pref…#1079

Open
sunweaver wants to merge 1 commit into
ArcticaProject:3.6.xfrom
sunweaver:pr/custom-nxdialog-caption
Open

nxcomp/src/Loop.cpp: Support NXTransDialog caption / title being pref…#1079
sunweaver wants to merge 1 commit into
ArcticaProject:3.6.xfrom
sunweaver:pr/custom-nxdialog-caption

Conversation

@sunweaver

Copy link
Copy Markdown
Member

…ixed with a custom prefix string.

Comment thread nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
Comment thread nxcomp/src/Loop.cpp
else
{
// Use what gets provided via NX_DIALOG_CAPTIONPREFIX (used in X2Go)
strncpy(caption, caption_prefix, DEFAULT_STRING_LENGTH-1);

@uli42 uli42 Jun 30, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this strncpy is different from the one above regarding the number of characters to be copied. While both are technically correct they should at least be unified.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you suggest a clean solution? (You are the C dev... ;-) ).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str(n)cpy is always tricky. I would do the getenv only once. Then strdup either the result or the default. And free the dupped string at shutdown.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uli42 Can you help with this MR and fine-polish it? Your C is so much better than mine.

@uli42

uli42 commented Nov 20, 2024 via email

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants