unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] math: enhance the endloop condition of function handle_input_flag
@ 2019-10-28  8:01 liqingqing
  2019-11-07  0:32 ` Joseph Myers
  0 siblings, 1 reply; 4+ messages in thread
From: liqingqing @ 2019-10-28  8:01 UTC (permalink / raw
  To: libc-alpha, hushiyuan, liusirui

     review the source code of function "handle_input_flag" and found 
that the endloop condition is not correct,
cause when the loop variable " i " euqal to 16, then the input_flags[16] 
will be out of bounds.
though I  think for now the inputs maybe all right, but just enhanced it.

---
  math/gen-auto-libm-tests.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/math/gen-auto-libm-tests.c b/math/gen-auto-libm-tests.c
index f15af29a4e0..08684c4646d 100644
--- a/math/gen-auto-libm-tests.c
+++ b/math/gen-auto-libm-tests.c
@@ -1298,7 +1298,7 @@ handle_input_flag (char *arg, input_flag *flag,
    char c = *ep;
    *ep = 0;
    bool found = false;
-  for (input_flag_type i = flag_first_flag; i <= num_input_flag_types; i++)
+  for (input_flag_type i = flag_first_flag; i < num_input_flag_types; i++)
      {
        if (strcmp (arg, input_flags[i]) == 0)
      {
-- 
2.23.0.windows.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] math: enhance the endloop condition of function handle_input_flag
  2019-10-28  8:01 [PATCH] math: enhance the endloop condition of function handle_input_flag liqingqing
@ 2019-11-07  0:32 ` Joseph Myers
  2019-11-07  1:01   ` liqingqing
  2019-11-07  6:59   ` liqingqing
  0 siblings, 2 replies; 4+ messages in thread
From: Joseph Myers @ 2019-11-07  0:32 UTC (permalink / raw
  To: liqingqing; +Cc: libc-alpha, hushiyuan, liusirui

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]

On Mon, 28 Oct 2019, liqingqing wrote:

>     review the source code of function "handle_input_flag" and found that the
> endloop condition is not correct,
> cause when the loop variable " i " euqal to 16, then the input_flags[16] will
> be out of bounds.
> though I  think for now the inputs maybe all right, but just enhanced it.

Thanks, committed with a somewhat edited commit message.  Note: I had to 
apply the patch manually as it appears your mailer inserted some Unicode 
space characters in it.  Patches inserted in the body of an email need to 
be verbatim with no whitespace changes from the email client for it to be 
possible to apply them, so if that's a problem they should be attached 
rather than included directly in the body of the email.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] math: enhance the endloop condition of function handle_input_flag
  2019-11-07  0:32 ` Joseph Myers
@ 2019-11-07  1:01   ` liqingqing
  2019-11-07  6:59   ` liqingqing
  1 sibling, 0 replies; 4+ messages in thread
From: liqingqing @ 2019-11-07  1:01 UTC (permalink / raw
  To: Joseph Myers; +Cc: libc-alpha, hushiyuan, liusirui



On 2019/11/7 8:32, Joseph Myers wrote:
> On Mon, 28 Oct 2019, liqingqing wrote:
> 
>>      review the source code of function "handle_input_flag" and found that the
>> endloop condition is not correct,
>> cause when the loop variable " i " euqal to 16, then the input_flags[16] will
>> be out of bounds.
>> though I  think for now the inputs maybe all right, but just enhanced it.
> 
> Thanks, committed with a somewhat edited commit message.  Note: I had to
> apply the patch manually as it appears your mailer inserted some Unicode
> space characters in it.  Patches inserted in the body of an email need to
> be verbatim with no whitespace changes from the email client for it to be
> possible to apply them, so if that's a problem they should be attached
> rather than included directly in the body of the email.
> 

hello joseph, thanks for the improvement suggestions to me, this patch 
was maked by "git format-patch" and sent to the libc-alpha maillist  was 
used by "git send-email" in a windows git-bash enviornment. I think i 
need to check my configuration again and find what happend. thank you.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] math: enhance the endloop condition of function handle_input_flag
  2019-11-07  0:32 ` Joseph Myers
  2019-11-07  1:01   ` liqingqing
@ 2019-11-07  6:59   ` liqingqing
  1 sibling, 0 replies; 4+ messages in thread
From: liqingqing @ 2019-11-07  6:59 UTC (permalink / raw
  To: Joseph Myers; +Cc: libc-alpha, hushiyuan, liusirui



On 2019/11/7 8:32, Joseph Myers wrote:
> On Mon, 28 Oct 2019, liqingqing wrote:
> 
>>     review the source code of function "handle_input_flag" and found that the
>> endloop condition is not correct,
>> cause when the loop variable " i " euqal to 16, then the input_flags[16] will
>> be out of bounds.
>> though I  think for now the inputs maybe all right, but just enhanced it.
> 
> Thanks, committed with a somewhat edited commit message.  Note: I had to 
> apply the patch manually as it appears your mailer inserted some Unicode 
> space characters in it.  Patches inserted in the body of an email need to 
> be verbatim with no whitespace changes from the email client for it to be 
> possible to apply them, so if that's a problem they should be attached 
> rather than included directly in the body of the email.
> 

I think maybe the default_charset is not utf-8?


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-07  7:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-28  8:01 [PATCH] math: enhance the endloop condition of function handle_input_flag liqingqing
2019-11-07  0:32 ` Joseph Myers
2019-11-07  1:01   ` liqingqing
2019-11-07  6:59   ` liqingqing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).