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

  • SEARCH
  • Home
  • 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

Related Questions

Using the following function: // remove multiple, leading or trailing spaces function trim(s) {
Is there any way to trim (remove leading/trailing spaces) the input entered by a
I need to trim the leading and trailing spaces from a multiline string. I've
Trim leading and trailing spaces from name undefined. trimName accepts a person as an
How do I trim leading zeros and trailing zeros using rereplace? It has something
I want to trim the value (strip leading and trailing spaces) and make first
How do I split string using String.split() without having trailing/leading spaces or empty values?
I just came across the interesting problem of trying to trim the leading zeroes
http://php.net/manual/en/function.trim.php The manual entry does say that I can remove any specified leading or
I need to trim all the trailing white spaces from the text elements of

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.