Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    113

    Two possibilities. You either need to save the...

    Two possibilities. You either need to save the current number of used elements as an extra int in item, or you could use a special value to indicate unused elements (or at least the first unused...
  2. Replies
    10
    Views
    238

    It would be exactly what you originally posted....

    It would be exactly what you originally posted. The simplified example was supposed to make it easier to see what's going on.


    So?


    No. Yours has 5 arguments.


    I never asked about...
  3. Replies
    10
    Views
    238

    I doubt it's a bug in clang. It's unlikely that...

    I doubt it's a bug in clang. It's unlikely that they declared ReadFile and WriteFile to be void*, which seems to be what the error is saying.

    No, your conversion is wrong. You can't just mention...
  4. Replies
    8
    Views
    216

    You've lost me. I don't see any mention of...

    You've lost me. I don't see any mention of threads.

    A nitpick: you should probably remove the W at the end of strEvalResultW since that would usually indicate you are using CStringW...
  5. Replies
    10
    Views
    238

    The original code should work just fine as long...

    The original code should work just fine as long as ReadFile and WriteFile have been properly declared. Are you including <windows.h> ?
  6. Replies
    8
    Views
    216

    I don't see what this has to do with Unicode....

    I don't see what this has to do with Unicode.
    Nothing, apparently, or at least the underlying UTF-8 encoding is not part of your problem.
    But you obviously can't use strlen on a stringstream.
    How...
  7. Replies
    8
    Views
    216

    This seems to have very little (if anything) to...

    This seems to have very little (if anything) to do with Unicode.

    Are you knowingly using ATL/MFC?
    Are you sure you want to use CString (more specifically, for some reason, CStringA)?
    Using...
  8. Replies
    6
    Views
    267

    Order of evaluation - cppreference.com...

    Order of evaluation - cppreference.com
  9. Thread: buffer overflow

    by john.c
    Replies
    6
    Views
    211

    @flp1969, that's an interesting point. However,...

    @flp1969, that's an interesting point. However, without optimization, it still works even without the pointer (and getting rid of the printing of individual bytes). I think non-optimized code usually...
  10. Thread: buffer overflow

    by john.c
    Replies
    6
    Views
    211

    This works for me (without optimizations). ...

    This works for me (without optimizations).


    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>

    int main()
    {
    int n = 0;
  11. Replies
    2
    Views
    160

    It's hard for me to imagine a use case where I...

    It's hard for me to imagine a use case where I cared that an array was sorted but didn't care whether it was ascending or descending. Probably not worth a dedicated function.

    You could define...
  12. Replies
    6
    Views
    359

    @Exosomes, in glibc, if the "salt" starts with...

    @Exosomes, in glibc, if the "salt" starts with "$6$" then SHA-512 is used (and the salt is the letters from the second $ to the next $).
  13. Replies
    6
    Views
    359

    Thanks for the info. I took another look but...

    Thanks for the info. I took another look but still can't find the vulnerability. I'll probably take another look at it later today. Definitely let us know when you figure it out or are told. I wonder...
  14. Replies
    6
    Views
    359

    There doesn't seem to be any possible buffer...

    There doesn't seem to be any possible buffer overruns since all inputs use fgets calls and they are all properly limited. The strcats don't seem to be able to overflow either.


    Something strange...
  15. Replies
    3
    Views
    394

    What exactly did you do? (Post code/script.) How...

    What exactly did you do? (Post code/script.)
    How exactly did it not work?
  16. #include #include void...

    #include <stdio.h>
    #include <math.h>

    void Maclurin(float x, float es, int maxIter);

    int main()
    {
    Maclurin(1, 0.05 , 100);
    return 0;
    }
  17. Replies
    20
    Views
    701

    CHAR_BIT can never be less than 8. See 5.2.4.2.1...

    CHAR_BIT can never be less than 8.
    See 5.2.4.2.1 of the C11 standard.
  18. Replies
    4
    Views
    350

    Nobody tried to "figure it out".

    Nobody tried to "figure it out".
  19. Replies
    7
    Views
    395

    Your code doesn't make any sense. Presumably you...

    Your code doesn't make any sense.
    Presumably you mean something like this:


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    char **f() // no need to pass the variable in
    {
  20. Replies
    13
    Views
    507

    Page 13 of N1570...

    Page 13 of N1570 says
  21. Replies
    13
    Views
    507

    If you want to ignore a parameter: #include...

    If you want to ignore a parameter:


    #include <stdio.h>

    int main(int argc, char **argv) {
    (void)argv;
    printf("%d\n", argc);
    return 0;
    }
  22. Replies
    9
    Views
    427

    You created the arrays to be a certain size....

    You created the arrays to be a certain size.
    That is the size they are.
    They do not magically change their size just because you try to access memory outside the array bounds.

    BTW, I didn't say...
  23. Replies
    9
    Views
    427

    Array a is m elements long. Array b is n elements...

    Array a is m elements long. Array b is n elements long.
    So neither of them is big enough to hold n + m elements.
  24. Maybe you are supposed to ignore a bit that...

    Maybe you are supposed to ignore a bit that overflows (at least under certain conditions). Then the answer is 1, as expected.
  25. Replies
    1
    Views
    397

    Presumably your first example is supposed to call...

    Presumably your first example is supposed to call foo1 and your second is supposed to call foo2 (with a properly defined s).

    The postfix increment operator has higher precedence than the...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4