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 7579385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:39:57+00:00 2026-05-30T17:39:57+00:00

My application falls over when I make the following call to strcat any ideas

  • 0

My application falls over when I make the following call to strcat any ideas why?

char *encryptedLine[255] = {0};  
char encryptedLString[8];        
sprintf(encryptedLString, "%08lX", L);
strcat(*encryptedLine, encryptedLString);  
  • 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-30T17:39:59+00:00Added an answer on May 30, 2026 at 5:39 pm

    *encryptedLine is NULL pointer: it needs to point a char buffer.

    *encyptedLine is equivalent to encryptedLine[0], which is the first entry in the array of char* encryptedLine:

    char *encryptedLine[255] = { 0 };
    

    which is a NULL pointer.

    To fix, either change to:

    char encryptedLine[255] = { 0 };
    
    strcat(encryptedLine, encryptedString);
    

    or:

    encryptedLine[0] = malloc(255);
    strcat(*encryptedLine, encryptedString);
    

    I think you also need to increase the size of encryptedLString by 1 as:

    sprintf(encryptedLString, "%08lX", L);
    

    will attempt to write 9 characters: 8 specified by the format plus 1 for the null terminator:

    char encryptedLString[9];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When a C/C++ application fails with the following CRITICAL, can you please tell me
I'm trying to test DataBinding within a WinForm application. The following test case fails.
I have ported over some code from a Windows application to Monotouch. It is
I have an ASP.Net Framework 4 web application making an interop call to a
HI I have the following code, when I call the Ping method the first
I have a command-line application written in C++ and built with gcc/make that runs
We are deploying memcached for our application, and I would like to make it
I finally have finished a Web Application and now I have to make it
I'm working on an application that is split over multiple assemblies. Each of the
I've to make an application that shows information about a F1 race. In order

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.