Substring function in C
Argument confusion
If you were trying to replicate the java substring function, you should have had a start and end argument.  As it is, you have a start and length argument, but you didn't handle the length argument correctly.
Bug 1
This line doesn't correctly check for the case of copying off the end of the source string:

if (start &gt; stringLength || len &gt; stringLength || start &lt; 0 || len &lt; 0) {


It needs to be:
if (start + len &gt; stringLength || start &lt; 0 || len &lt; 0) {

Edit: If you want to check for integer overflow, you can also throw in || start + len &lt; 0, and use size_t everywhere instead of int.
Bug 2
This check is unnecessary and can return an error incorrectly:

if (start &gt;= len) {
    fputs(&quot;start must be start &lt; len&quot;, stderr);
    return -1;
}


For example, if the string has 10 bytes, start is 8 and len is 1, this check will return an error.
Bug 3
When you terminate the destination string, you use the wrong index.  It should be len, not stringLength.  Also, I'm not sure why you do a check before you write to it:

if (destination[stringLength] != '\x0') {
    destination[stringLength] = '\x0';
}


should be:
destination[len] = '\0';

Also, '\0' is the standard way to write the null character.  I've never seen it written as '\x0' before.
Unnecessary local variable
The variable substringLength is unnecessary because it is always the same as len.  You can just use len instead.
Return value
The java substring function returns the string.  Your function returns the length but I don't think that this will be useful to the caller.  The reason you might want to return a string is so you can chain calls like this:
strcat(substring(buf, path, dir_start, dir_length), basename);