gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master a42ac37 085/113: Fixed MakeProfiles loop in ch


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master a42ac37 085/113: Fixed MakeProfiles loop in checking radius values
Date: Fri, 16 Apr 2021 10:33:54 -0400 (EDT)

branch: master
commit a42ac3769d174eb870656b89693eb2834a23a4bb
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Fixed MakeProfiles loop in checking radius values
    
    While checking the radius column values in MakeProfile's `ui_read_cols_3d',
    we hadn't actually defined a loop on `i'. Therefore the `i' value from the
    previous loop would remaina and cause an undefined profile code error. With
    this commit a loop is added and this bug is fixed.
---
 bin/mkprof/ui.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index f37dc6a..a4801f1 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -941,11 +941,12 @@ ui_read_cols_3d(struct mkprofparams *p)
           p->r=corrtype->array;
 
           /* Check if there is no negative or zero-radius profile. */
-          if(p->f[i]!=PROFILE_POINT && p->r[i]<=0.0f)
-            error(EXIT_FAILURE, 0, "%s: row %zu, the radius value %g is "
-                  "not acceptable for a `%s' profile. It has to be larger "
-                  "than 0", p->catname, i+1, p->r[i],
-                  ui_profile_name_write(p->f[i]));
+          for(i=0;i<p->num;++i)
+            if(p->f[i]!=PROFILE_POINT && p->r[i]<=0.0f)
+              error(EXIT_FAILURE, 0, "%s: row %zu, the radius value %g is "
+                    "not acceptable for a `%s' profile. It has to be larger "
+                    "than 0", p->catname, i+1, p->r[i],
+                    ui_profile_name_write(p->f[i]));
           break;
 
         case 6:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]