Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sbi/src/os/helenos.c

    r051bc69a r38aaacc2  
    2929/** @file HelenOS-specific code. */
    3030
    31 #include <assert.h>
    3231#include <errno.h>
    3332#include <stdio.h>
     
    3635#include <task.h>
    3736#include <tinput.h>
    38 #include <str_error.h>
    3937
    4038#include "os.h"
     
    7472
    7573        return str;
    76 }
    77 
    78 /** Return slice (substring) of a string.
    79  *
    80  * Copies the specified range of characters from @a str and returns it
    81  * as a newly allocated string. @a start + @a length must be less than
    82  * or equal to the length of @a str.
    83  *
    84  * @param str           String
    85  * @param start         Index of first character (starting from zero).
    86  * @param length        Number of characters to copy.
    87  *
    88  * @return              Newly allocated string holding the slice.
    89  */
    90 char *os_str_aslice(const char *str, size_t start, size_t length)
    91 {
    92         char *slice;
    93         size_t offset;
    94         size_t i;
    95         size_t size;
    96         wchar_t c;
    97 
    98         assert(start + length <= str_length(str));
    99 
    100         offset = 0;
    101         for (i = 0; i < start; ++i) {
    102                 c = str_decode(str, &offset, STR_NO_LIMIT);
    103                 assert(c != '\0');
    104                 assert(c != U_SPECIAL);
    105                 (void) c;
    106         }
    107 
    108         size = str_lsize(str, length);
    109         slice = str_ndup(str + offset, size);
    110 
    111         return slice;
    11274}
    11375
     
    224186        int retval;
    225187
    226         tid = task_spawn(cmd[0], (char const * const *) cmd, &retval);
     188        tid = task_spawn(cmd[0], (char const * const *) cmd);
    227189        if (tid == 0) {
    228                 printf("Error: Failed spawning '%s' (%s).\n", cmd[0],
    229                     str_error(retval));
     190                printf("Error: Failed spawning '%s'.\n", cmd[0]);
    230191                exit(1);
    231192        }
Note: See TracChangeset for help on using the changeset viewer.