# HG changeset patch # User Paul Boddie # Date 1663358869 -7200 # Node ID 5353463f6a2fa5b498c42ee84df5281f6231c654 # Parent d1d34f2d70344e2b110956f3306e929b793c8815 Fixed the formatting specifiers for offset types. diff -r d1d34f2d7034 -r 5353463f6a2f libfsserver/lib/files/test_file_accessor.cc --- a/libfsserver/lib/files/test_file_accessor.cc Fri Sep 16 22:06:38 2022 +0200 +++ b/libfsserver/lib/files/test_file_accessor.cc Fri Sep 16 22:07:49 2022 +0200 @@ -1,7 +1,7 @@ /* * A test accessor producing generated content. * - * Copyright (C) 2021 Paul Boddie + * Copyright (C) 2021, 2022 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -68,7 +68,7 @@ char tag[32]; - sprintf(tag, "%ld:%ld", fileid, filepos); + sprintf(tag, "%ld:%lld", fileid, filepos); memset((void *) addr, 0, strlen(tag) + 1); strcpy((char *) addr, tag); diff -r d1d34f2d7034 -r 5353463f6a2f tests/dstest_test_client.cc --- a/tests/dstest_test_client.cc Fri Sep 16 22:06:38 2022 +0200 +++ b/tests/dstest_test_client.cc Fri Sep 16 22:07:49 2022 +0200 @@ -100,18 +100,19 @@ /* Test the data obtained. */ - unsigned long filepos = file.start_pos + offset; - unsigned long _fileid = 0, _filepos = 0; + offset_t filepos = file.start_pos + offset; + unsigned long _fileid = 0; + offset_t _filepos = 0; char *sep = strchr(buf, ':'); if (sep != NULL) { *sep = '\0'; sep++; - _fileid = atol(buf); _filepos = atol(sep); + _fileid = atol(buf); _filepos = atoll(sep); } if ((fileid != _fileid) || (filepos != _filepos)) - printf("! %ld:%ld is not %ld:%ld\n", _fileid, _filepos, fileid, filepos); + printf("! %ld:%lld is not %ld:%lld\n", _fileid, _filepos, fileid, filepos); } }