Changeset 61c91532 in mainline for kernel/generic/src/printf/vprintf.c


Ignore:
Timestamp:
2025-04-17T16:18:27Z (5 days ago)
Author:
GitHub <noreply@…>
Children:
634340fd
Parents:
a65ccc4 (diff), 888c06e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Wayne Thornton <wmthornton-dev@…> (2025-04-17 16:18:27)
git-committer:
GitHub <noreply@…> (2025-04-17 16:18:27)
Message:

Merge branch 'HelenOS:master' into master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/printf/vprintf.c

    ra65ccc4 r61c91532  
    3737#include <print.h>
    3838#include <printf_core.h>
    39 #include <putchar.h>
    4039#include <str.h>
    4140#include <synch/spinlock.h>
     
    4443static errno_t vprintf_str_write(const char *str, size_t size, void *data)
    4544{
    46         size_t offset = 0;
    47 
    48         while (offset < size)
    49                 putuchar(str_decode(str, &offset, size));
    50 
     45        putstr(str, size);
    5146        return EOK;
    5247}
     
    5449int puts(const char *str)
    5550{
    56         size_t offset = 0;
    57         size_t chars = 0;
    58         char32_t uc;
    59 
    60         console_lock();
    61 
    62         while ((uc = str_decode(str, &offset, STR_NO_LIMIT)) != 0) {
    63                 putuchar(uc);
    64                 chars++;
    65         }
    66 
    67         putuchar('\n');
    68 
    69         console_unlock();
    70         return chars;
     51        size_t n = str_size(str);
     52        putstr(str, n);
     53        return n;
    7154}
    7255
Note: See TracChangeset for help on using the changeset viewer.