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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:54:34+00:00 2026-05-10T18:54:34+00:00

To trim the leading spaces we are using strmove. But we were advised to

  • 0

To trim the leading spaces we are using strmove. But we were advised to use strlmove instead of strmove. I have read and used strlcpy and strlcat. Whether strlmove does the similar functionality and what all are its advantages?

Edit 1: Thank you Mike B and Chris Young. This is how we use strlcpy.

size_t strlcpy(char *dst, const char *src, size_t size) {     strncpy(dst, src, size - 1);     dst[size - 1] = '\0';     return(strlen(src)); } 

So I was just thinking of using strlmove() also in the same way. I want to confirm whether any specifications is defined regarding the implementation of strlmove(). I know this is one of the best place i can ask.

Edit 2: strlmove() is implemented the same way as strlcpy() and strlcat() using memmove().

size_t strlmove(char *dst, const char *src, size_t size) {     //Error if the size is 0     //If src length is greater than size;      //   memmove(dst, src, size-1) and dst[size] = \0;     //Otherwise     //   memmove(dst, src, length(src));     return source len; } 

Appreciate the help and support provided.

Thanks, Mathew Liju

  • 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. 2026-05-10T18:54:34+00:00Added an answer on May 10, 2026 at 6:54 pm

    As Chris Young mentions, these routines are not standard (or as far as I known in wide, common use) so I can’t be 100% certain with more specifics, but:

    Typically the strl() variations of str() routines take an additional parameter that indicates the size of the destination buffer. The routine guarantees that it will not write data past the end of the buffer (since it knows the size). Usually strl() functions will also guarantee that they will place a terminating null character at the end of the string or at the end of the buffer (potentially truncating any string created there) so that you are also guaranteed to have a terminated string that will be generally OK to pass to other str() functions. Note that if the length of the buffer is specified as 0 (zero) the function will not place a terminating null character (as there’s no room in the buffer for anything).

    In my opinion, it’s nearly always better to use a strl() (or strn()) function in preference to the corresponding str() routine to prevent buffer overruns.

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

Sidebar

Ask A Question

Stats

  • Questions 83k
  • Answers 83k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think this should be detected as an event on… May 11, 2026 at 4:48 pm
  • Editorial Team
    Editorial Team added an answer SketchPath looks like it might help (and is free) May 11, 2026 at 4:48 pm
  • Editorial Team
    Editorial Team added an answer Your editor is generating backup files of the form FILENAME~.… May 11, 2026 at 4:48 pm

Related Questions

Should users be able to enter a password such as 12345 or 12345 –
I'm creating a class to store a filename. To do so, I need to
I need to pad numbers with leading zeros (total 8 digits) for display. I'm
I am trying to create a WHERE clause that says WHERE column_1 = TRIM(LEADING

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.