guy_c:
Thanks. Must I understand that it worked by chance and that it may -depending upon the execution time? stop working?
I think that @arduino_new is confused - if you had returned a pointer to "ip", then you would have had a problem, because the pointer would be to a variable on the stack that could be overwritten at any time after the return from the function.
But you're returning the variable itself, so that's OK.