summary refs log tree commit diff
path: root/argp
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-05-10 06:39:15 +0000
committerUlrich Drepper <drepper@redhat.com>2006-05-10 06:39:15 +0000
commit400cc70af5972a50618702da02d18aee845ce542 (patch)
tree5aec81730804ff70928434f12d9ffa3dc0954c13 /argp
parent51e5926049360b991d71862e33a97fe1ead4d9a6 (diff)
downloadglibc-400cc70af5972a50618702da02d18aee845ce542.tar.gz
glibc-400cc70af5972a50618702da02d18aee845ce542.tar.xz
glibc-400cc70af5972a50618702da02d18aee845ce542.zip
* io/ftw.c (open_dir_stream): Return right away if REALLOC fails.
	[Coverity CID 229, 230]

	* argp/argp-help.c (hol_entry_help): Handle STATE==NULL in ARG and
	DGETTEXT calls.
	(hol_help): Likewise.  [Coverity CID 226, 227]

	* string/argz-replace.c (__argz_replace): Unconditionally call
	free on SRC.  [Coverity CID 225]

	* nis/nis_creategroup.c (nis_creategroup): No need to duplicate
	the return value of __nis_default_owner and __nis_default_group,
	it has been especially allocated.  [Coverity CID 224]
Diffstat (limited to 'argp')
-rw-r--r--argp/argp-help.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/argp/argp-help.c b/argp/argp-help.c
index 7ba621b735..13c0820710 100644
--- a/argp/argp-help.c
+++ b/argp/argp-help.c
@@ -1105,7 +1105,9 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
 	    __argp_fmtstream_putc (stream, '-');
 	    __argp_fmtstream_putc (stream, *so);
 	    if (!have_long_opt || uparams.dup_args)
-	      arg (real, " %s", "[%s]", state->root_argp->argp_domain, stream);
+	      arg (real, " %s", "[%s]",
+		   state == NULL ? NULL : state->root_argp->argp_domain,
+		   stream);
 	    else if (real->arg)
 	      hhstate->suppressed_dup_arg = 1;
 	  }
@@ -1125,7 +1127,8 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
 	       have been done on the original; but documentation options
 	       should be pretty rare anyway...  */
 	    __argp_fmtstream_puts (stream,
-				   dgettext (state->root_argp->argp_domain,
+				   dgettext (state == NULL ? NULL
+					     : state->root_argp->argp_domain,
 					     opt->name));
 	  }
     }
@@ -1138,7 +1141,8 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
 	  {
 	    comma (uparams.long_opt_col, &pest);
 	    __argp_fmtstream_printf (stream, "--%s", opt->name);
-	    arg (real, "=%s", "[=%s]", state->root_argp->argp_domain, stream);
+	    arg (real, "=%s", "[=%s]",
+		 state == NULL ? NULL : state->root_argp->argp_domain, stream);
 	  }
     }
 
@@ -1157,7 +1161,8 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
     }
   else
     {
-      const char *tstr = real->doc ? dgettext (state->root_argp->argp_domain,
+      const char *tstr = real->doc ? dgettext (state == NULL ? NULL
+					       : state->root_argp->argp_domain,
 					       real->doc) : 0;
       const char *fstr = filter_doc (tstr, real->key, entry->argp, state);
       if (fstr && *fstr)
@@ -1205,7 +1210,8 @@ hol_help (struct hol *hol, const struct argp_state *state,
 
   if (hhstate.suppressed_dup_arg && uparams.dup_args_note)
     {
-      const char *tstr = dgettext (state->root_argp->argp_domain, "\
+      const char *tstr = dgettext (state == NULL ? NULL
+				   : state->root_argp->argp_domain, "\
 Mandatory or optional arguments to long options are also mandatory or \
 optional for any corresponding short options.");
       const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE,