From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: Printing to STDERR when %d is "Cannot access memory ..." Date: Wed, 13 Jun 2018 12:34:01 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1528918333 8280 195.159.176.226 (13 Jun 2018 19:32:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2018 19:32:13 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Davis Herring Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 13 21:32:08 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fTBV1-0001y0-D1 for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 21:32:08 +0200 Original-Received: from localhost ([::1]:36547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTBX6-0000nq-Ij for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 15:34:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTBX0-0000n4-2H for emacs-devel@gnu.org; Wed, 13 Jun 2018 15:34:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTBWw-0003Yp-11 for emacs-devel@gnu.org; Wed, 13 Jun 2018 15:34:09 -0400 Original-Received: from gateway23.websitewelcome.com ([192.185.50.161]:33069) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTBWv-0003Xc-Rf for emacs-devel@gnu.org; Wed, 13 Jun 2018 15:34:05 -0400 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 93DFB844B for ; Wed, 13 Jun 2018 14:34:04 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id TBWufYGYMSjJATBWuf72Ef; Wed, 13 Jun 2018 14:34:04 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=OE2BCQmnywpXznqQw6mNlG8qORbS/knY6WqqJe7MG3I=; b=kEGH3bq8NgGRpyHoTWWp3cEDVD wCnXHTyYcBvxnqvh1cTj+DZ+7J8tdy/xuJkfzoJhDUfBG+oqeSCkERRHHYzrkH+elp5EctmdCw5Yp xENqE20z8m2aDzRz+6d7VawFA13lGDXGtL8IswQaPGK+7LqClLnK+XSHweO+qGPVt5VB6pj6PksgE SYy9zkjqIStrGtnEh24k8eQ96JRnR3pv8a56vzctR3CokBsdt/QZMhOxI4lvtFhh8KuZ/KWyyFNST uOZecCUC28Yd2Q4KzMnpXwyKWERBMjfP1z7fjr0SwROQKzoBujrEopzDFItj9klRcAXLDNgWXOAr9 5ELquVWg==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51865 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1fTBWt-000qmk-40; Wed, 13 Jun 2018 14:34:03 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1fTBWt-000qmk-40 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51865 X-Source-Auth: lawlist X-Email-Count: 2 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.50.161 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226306 Archived-At: Thank you, Davis, for teaching me how to deal with a NULL pointer when printing to STDERR. Your code works well. Greatly appreciated! Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [06-13-2018 11:50:13] <13 Jun 2018 12:50:13 -0600> FROM: Davis Herring > > > fprintf (stderr, "(%d)", (font->space_width == NULL > > ? 0 > > : font->space_width); > > > > However, that didn't fix the problem. > > You meant > > fprintf (stderr, "(%d)", font == NULL ? 0 : > font->space_width); > > It's font that could be null, not its space_width. > > Davis > > PS - This says nothing about why font is null -- it might be a bug, or > it might just be a bug that this code uses it without checking. > > -- > This product is sold by volume, not by mass. If it appears too dense or > too sparse, it is because mass-energy conversion has occurred during > shipping.