Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6157663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:49:27+00:00 2026-05-23T20:49:27+00:00

I am at a loss here. Will post my code in a short while…just

  • 0

I am at a loss here.
Will post my code in a short while…just that its too long to extract portions of the “troubling” giving code. Will expalin my issue here: I store a string(path to a file or directory) in an array of structure { char *path; size_t path_len} where path is the string and path_en its length. On inserting the path_len is 76. On extracting from the array with strncpy the string length becomes 78 or even a simple strlen of the string within the array says 77.

All other cases with original string length lesser then 77 works just fine.

I am baffled.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:49:27+00:00Added an answer on May 23, 2026 at 8:49 pm

    With strncpy — do you remember to null terminate the resulting copied string?

    Strncpy does not null terminate strings if they are longer than N (N being the 3rd argument you pass to strncpy)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am seriously at a loss here. The three things that will not change
I'm at a loss here. I have this class I've created that takes arguments
I'm at loss at how to describe this without code, so here it goes:
I'm looking for a Windows network emulator that can emulate the packet-loss & latency
Reward: Has been claimed. Overview: The code giving me the problem is deployed here:
I am at a loss here of a best-practice to pass XML back and
I am really at a loss here, and have been trying to find a
Here's the code: $(document).ready(function(){ $(.menu ul li a).click( function(){ curpage = $(this).attr('href'); loadpage(curpage); });
I may just be missing something obvious here, so I apologize if this is
I'm building a webapp for a department on a large college campus that will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.