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

 
 

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

Submitter:  None
Submitted:  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
* Mandatory Fields

Add a New Comment Rich Markup
   

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

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.13-4448.
Corresponding source code