[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hc: don't segfault if DISPLAY can't be opened
- To: Florian Bruhin <me _at_ the _minus_ compiler _dot_ org>
- Subject: Re: [PATCH] hc: don't segfault if DISPLAY can't be opened
- From: Thorsten Wißmann <re06huxa _at_ cip _dot_ cs _dot_ fau _dot_ de>
- Date: Mon, 5 Nov 2012 17:45:14 +0100
On Mon, Nov 05, 2012 at 01:29:19PM +0100, Florian Bruhin wrote:
> Yes, I know, I'm bombarding this ML with patches. I'm done soon with
> the smaller things I think.
No Problem :) That's what the ML was created for!
> While developing I accidentally did run herbstclient over an SSH
> connection without DISPLAY set and it segfaulted, I thought it might
> be better to output some error message and exit gracefully.
>
> If there is any better way of contributing (e.g. you pulling from my
> git repo or whatever) that's fine for me as well, just let me know.
I personally prefer patches, because in my opinion it's unclean to amend
commits that are available in a public repository. And amending commits
or changing the order of patches often is necessary. (Both is in this
case).
> HCConnection* hc_connect() {
> Display* display = XOpenDisplay(NULL);
> + if (display == NULL) {
> + return NULL;
> + }
^
|
I removed that trailing whitespace and merged it as:
252d48b Don't segfault when DISPLAY can't be opened in hc
Thorsten