bugXlog - Bugs: bug #60391, adif3.c compile fail in scrncpy by...

 
 

bug #60391: adif3.c compile fail in scrncpy by line 527.

Submitted by:  None
Submitted on:  Wed 14 Apr 2021 03:19:50 AM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 14 Apr 2021 03:21:30 AM UTC, comment #1: 

Oh, email: -email is unavailable-

Anonymous
Wed 14 Apr 2021 03:19:50 AM UTC, original submission:  

Building on Slackware 15,0-beta
  gcc 10.3
  gtk 2.2.24

The strncpy construct in adif3.c (by line 527) fails due to "assining src to itself". I tried 2.0.21 and the related section complained of a null destination record.

The workaround uses the algorithm for strncpy.

The code is (j added as a gint)

 qfield = q[fld];
  space_ptr = q[fld];
  space_ptr = strpbrk (space_ptr, " ");
  qfield_len = space_ptr - qfield;         // length of string from start to space

  if (qfield_len == 0) {                   // if no space, then the field is either null or somehow malformed
qfield = q[fld];
  } else {
for (j = 0; j < qfield_len && qfield[j] != '\0'; j++)
    qfield[j] = qfield[j];
                        for ( ; j < qfield_len; j++)
                    qfield[j] = '\0';
// strncpy (qfield, q[fld], qfield_len);  // Save the string from start to space, not including the space.
qfield[qfield_len] = '\0';             // Null terminate the desired string
  }
}

This gives a successful build.

Peter Brooks AI7FN (not on the air yet due to medical issues.)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #51263:  adif3.c added by None (25KiB - text/x-csrc - This works. Using SlackBuild and Hamlib.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

 

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2021-04-14 None Attached File- => Added adif3.c, #51263

Back to the top


Powered by Savane 3.7