Bug 204252 - usr/src/lib/libdpv/dprompt.c:92: possible bad if ?
Summary: usr/src/lib/libdpv/dprompt.c:92: possible bad if ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-03 15:25 UTC by David Binderman
Modified: 2018-06-20 05:51 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2015-11-03 15:25:51 UTC
[usr/src/lib/libdpv/dprompt.c:92]: (warning) Char literal compared with pointer 'spin_cp'. Did you intend to dereference it?

Source code is

   if (spin_cp == '\0')

Maybe better code

   if (*spin_cp == '\0')
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-06-16 20:01:27 UTC
A commit references this bug:

Author: dteske
Date: Sat Jun 16 20:00:42 UTC 2018
New revision: 335264
URL: https://svnweb.freebsd.org/changeset/base/335264

Log:
  Fix comparison between pointer and char literal

  PR:		misc/204252
  Reported by:	David Binderman <dcb314@hotmail.com>
  MFC after:	3 days
  X-MFC-to:	stable/11, stable/10

Changes:
  head/lib/libdpv/dprompt.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-06-20 05:45:50 UTC
A commit references this bug:

Author: dteske
Date: Wed Jun 20 05:45:41 UTC 2018
New revision: 335406
URL: https://svnweb.freebsd.org/changeset/base/335406

Log:
  dpv(3): MFC r330943, r335264

  r330943:
  Fix bad error messages from dpv(3)

  Before = dpv: <__func__>: posix_spawnp(3): No such file or directory
   After = dpv: <path/cmd>: No such file or directory

  Most notably, show the 2nd argument being passed to posix_spawnp(3)
  so we know what path/cmd failed.

  Also, we don't need to have "posix_spawnp(3)" in the error message
  nor the function because that can [a] change and [b] traversed using
  a debugger if necessary.

  r335264:
  Fix comparison between pointer and char literal

  PR:		misc/204252
  Reported by:	David Binderman <dcb314@hotmail.com>
  Sponsored by:	Smule, Inc.

Changes:
_U  stable/11/
  stable/11/lib/libdpv/dialog_util.c
  stable/11/lib/libdpv/dprompt.c
  stable/11/lib/libdpv/util.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-06-20 05:51:58 UTC
A commit references this bug:

Author: dteske
Date: Wed Jun 20 05:50:55 UTC 2018
New revision: 335407
URL: https://svnweb.freebsd.org/changeset/base/335407

Log:
  dpv(3): MFC r330943, r335264

  r330943:
  Fix bad error messages from dpv(3)

  Before = dpv: <__func__>: posix_spawnp(3): No such file or directory
   After = dpv: <path/cmd>: No such file or directory

  Most notably, show the 2nd argument being passed to posix_spawnp(3)
  so we know what path/cmd failed.

  Also, we don't need to have "posix_spawnp(3)" in the error message
  nor the function because that can [a] change and [b] traversed using
  a debugger if necessary.

  r335264:
  Fix comparison between pointer and char literal

  PR:		misc/204252
  Reported by:	David Binderman <dcb314@hotmail.com>
  Sponsored by:	Smule, Inc.

Changes:
_U  stable/10/
  stable/10/lib/libdpv/dialog_util.c
  stable/10/lib/libdpv/dprompt.c
  stable/10/lib/libdpv/util.c