The value of len as suggested earlier by @oni-link does differ from the old code:

```c
// old
 long len;
  
  if (maxlen >= 0)
    len = maxlen;
  else
    len = (long)STRLEN(str);

// new
  size_t len = STRLEN(str);

  // truncate the incoming string to maxlen if necessary
  if (maxlen >= 0 && len > (size_t) maxlen) {
    len = (size_t) maxlen;
  }
```

And this might have an impact on functionality. Thoughts?